How to watch for Clipboard changes? (BB10 - multitasking issues, limitations?)

Hi people!

How to watch for Clipboard changes?

It sounds simple, huh?

This is the documentation for the Clipboard:

https://developer.BlackBerry.com/Cascades/reference/bb__system__clipboard.html

Since the library Qt than qclipboard only is not supported to BB10 there is no Signal as soon as the content of the Clipboard is changed. It is an essential feature that I need, so I need to get a working solution, even if it is not so optimal.

As far as I am able to judge I have to use a voting procedure to observe (example every 500ms) if the content has changed in the meantime. But I have a lot of questions.

It is a Simple slot called by a QTimer:

void Logic::pollingSlot() {
    QByteArray data = clipboard.value("text/plain");
    if (!data.isEmpty()) {
        QString test(data);
        // compare for changes
        if (prevoiusValue != test) {
            prevoiusValue = test;
            // it has changed since the last poll, now do your job
        }
    }
}

I set the Clipboard before everyone in my class.

This code works very well and is very low. It is therefore not too be able to consume, so I could live with.

BUT it only works if my application is in the foreground!

I don't understand why. If I start my code, switch to a different application, change the contents of the Clipboard 3 times and go back to my application the routine is able to recognize the last change to the Clipboard.

Even during debugging using a breakpoint, the poll routine is called when a different application is in the foreground but the Clipboard contains no changes so my code does not work until the other application goes in the background.

I don't know if the Clipboard lib is broken somehow or multitasking much heralded QNX is somehow limited or maybe broken.

All Tips how to get this working?

You specify run_when_backgrounded in your file descriptor-bar? Otherwise, the application will just pause when not full screen.

Before you slap just that, however, (or at least, after you do a quick check to see if that helps), I strongly suggest to read https://developer.blackberry.com/cascades/documentation/dev/fundamentals/index.html

I would consider as carefully as poll-every-5 approach will be acceptable, as who should say, it could lead to more battery or CPU consumption that would be considered acceptable. It could prevent the app to be accredited as a built for BlackBerry. I don't know what your alternatives would still, however, so I propose a solution, just a problem.

Tags: BlackBerry Developers

Similar Questions

  • How to advocate for regional change of short date format

    This is something relatively trivial but annoying all the same, but I don't know where to go to advocate for change.

    Have just updated for Sierra and one of the first things I notice is the addition of a point at the end of the month in short date format, i.e. 'September 19, 2016'.

    "In Australia, as in the United Kingdom, the standard must not use this period - it should be just'19 Sep 2016", and in the past, that's how it appeared in OSX for the Australia. Don't know why the change.

    This abbreviation is not replaceable by the user, so where can I go to provide appropriate feedback and I hope to have this problem on the track?

    A solution is to make my default language and region of the United Kingdom, but do not know if there is a price to pay for it.

    You can provide feedback to Apple asking them to change it:

    www.Apple.com/Feedback

  • How to prepare for the change of OS?

    The product name and number: HP ProBook 4740 s H5V06ES

     

    Operating system: SUSE Linux Enterprise Desktop 11

    Initially I was planing to dual boot this laptop with Win7 but I gave up this cause of the idea of recovery and HP_Tools partitions get in the way.

    I used the app to create HP Factory Image restore DVD in SLED 11. He created only wave disk.

    I do not plan to delete the recovery or the HP_Tools partition is so that all I have to do before I start?

    The laptop is brand new, so there is no personal files on this subject.

    I wiped the entire HARD drive, installed win7 again.

    I managed to recreate a HP_TOOLS on the HARD drive with the environment of Support HP Unified Extensible Firmware Interface (UEFI) from my laptop. For this you must .NET 2 minimum and a partition on your HARD disk should be in FAT32 and named HP_TOOLS).

    Start HP_TOOLS collaborates with F2.

    Before I recreated on the partition of drive I tested HP_TOOLS on USB I did and is also bootable with F2.

    So to answer so many questions about the removal of the HP_TOOLS: Yes, you can safely delete HP_TOOLS partition and re-create again if you wish.

  • Can I change the band on the watch for the ceramic version?

    Can I change the band on the watch for the ceramic version?

    Hello

    Yes - all Apple Watch bands will be adapted to any Apple Watch of the same size of the case (42mm or 38 mm).

  • How Apple can for me if my Apple Watch was stolen?

    How Apple can for me if my Apple Watch was stolen?

    Hello

    If the locking of Activation has been enabled on your watch, you can mark it as missing with the app on your iPhone or via iCloud.com watch.

    Instructions and more information on this feature is available here:

    Note that Apple Watch cannot be physically tracked / located in the same way as some other Apple devices.

  • Maps app shows wrong time, how do I get this changed for my business?

    My customers using cards iphone App get bad times for my business. Cards apps is from 18:00, we close at 5:30 and the Apple. My website, facebook, yelp, google maps and all the ads say 05:30. How do I get this changed on Maps Apple application?

    Send feedback to Apple. They will not respond, but at least know that there is a problem.

    Your comments

  • My adapter is broken. How to contact Toshiba to change a new one for me?

    My English is bad. I called toshiba In UK Via phone (0844 847 89440) but I did not express my idears. and I do not know what number must be entered after calling the telephone.

    I bought my labtop in China a month ago. Now I'm at the University of Edinburgh. A few days ago my adapter is broken. How to contact Toshiba to change a new one for me? (Or fix it for me). I hope someone can help me.

    Thank you.

    And I can't send my serial number in this site for repair: http://uk.computers.toshiba-europe.com/innovation/generic/WR.

  • Inadvertently, I had a graduated filter changed all 326 images in my folder. How can I remove this change of images without affecting other types of changes, I did for the other images?

    Inadvertently, I had a graduated filter changed all 326 images in my folder. How can I remove this change of images without affecting other types of changes, I did for the other images?

    Select all images, ensuring that you are in the develop module. Auto-Sync lights up and then just delete the graduated filter. You will need to activate the graduated filter tool and click on the PIN for the filter you have defined and then press the delete key. Then, you want to disable automatic synchronization. Now, just highlight the image you want to add the graduated filter and do your thing with her.

  • How to listen for changes in a ComboBox?

    I created a ComboBox with the following code:

    country of the var = ["Brazil',"Mexico","Argentina", 'Colombia', 'Venezuela', 'Italy', 'Chile', 'Ecuador', 'Dominican Republic', 'Guatemala', 'Costa Rica ', 'Uruguay', 'Bolivia',"Panama","El El Salvador","Paraguay", 'Honduras',"Trinidad and Tobago","Jamaica","Nicaragua", 'Haïti',"Bahamas","Barbados","Guyana","Suriname","Belize","Saint Lucia","Antigua and Barbuda","Granada","Saint Vincent and the Grenadines","Dominique", 'St. Kitts and Nevis'];

    var country = sym.$("country");

    var options = ";

    for (var i = 0; i < countries.length; i ++) {}

    var opt = country [i];

    options of += "< option >" + opt + ' < / option > ".

    }

    var inputCountry is $("< select id ="selectNumber">< totaux option > </option >'+ options + ' </select >');.

    inputCountry.css ('width', 120);

    inputCountry.appendTo (country);

    This works as expected. However, I don't know how to listen to the changes on the drop-down list.

    Any suggestions?

    Hi Gil1,

    Look here: http://api.jquery.com/change/

    Gil

  • How to configure the virtual machine for the changes to forget

    Hi, I want to ask if it is possible together in the virtual machine for the changes to forget. For example - user run VM... make some changes in the configuration. Then come a new user has it want to have clear (without changes in the configuration) virtual machine. Is possible together closed the machine after changes lost?

    Sorry for my English.

    Thanks for help.

    Hi Polo939

    First, you will need to take a snapshot of the virtual machine.

    • Select your virtual machine

    • Click on "take a snapshot" on the right-hand side of the web interface

    Then you must configure the virtual machine to go back to the snapshot when it is turned off.

    • Click on "configure the VM.

    • Click the "snapshot".

    • Select "back to overview" under when you feed off option

  • How Apple Watch to know or to calculate the intensity of my workouts?

    Hi all

    I used my Apple Watch now since some time in combination with the application of activity for different types of workouts such as running etc and I am curious about the watch or the activity app knows the intensity of a workout as a race.

    The rate watch or app works just like a similar race or does it somehow make a difference if a race is more or less "hard"?

    I am interested in this because I think that there is a difference if you go on a relaxed atmosphere, 10km run, or if you for example one very hard works on a mountain. Can watch it / app don't know if you use for example up the Hill?

    I was recently on a very relaxed ran about 10 km with my girlfriend. After such a race I feel very exhausted, but the activity app still said I burned some calories. Now another day I went to a really hard and fast race up a hill which was a lot however shorter, only about 6km. In this case the activity app said I burned fewer calories than on race relaxed and I really can't believe that run if I work very hard compared to a relaxed atmosphere.

    That's why I wanted to know how it actually works and hope someone can answer me.

    Thank you and best regards,

    Thomas

    Hi Thomas

    When follow you an activity using the application of the training session and specify a type of activity, your watch uses the most appropriate sensors and data sources to estimate the outcome of this workout.

    For example, when you save a run in the open air:

    • If you also take your iPhone along (with compatible Bluetooth and location Services), your watch can access the GPS of the iPhone data when estimating the PACE and distance.
    • If you do not take your iPhone along, the watch relies on data from the accelerometer in the estimate of the PACE and distance.
    • Data from the heart rate sensor is used during the estimation of the Active Calories, including calculations which are adapted to different activity types.

    Calibrate your watch helps improve the accuracy of the different estimates made by the activity and workout app app. More information and instructions for calibration of your watch are available via the link below.

    Estimates of the results will also depend on your personal information. To verify that this is correct - and update over time:

    • On your iPhone, in the application of the watch, go to: My Watch tab > health > edit - tap and adjust the settings, then press on in fact.

    More information:

    Calibrate your Apple Watch for better accuracy of training and activity - Apple Support

    Use the activity on your Apple Watch - Apple Support

    Use of the workout on your Apple Watch - Apple Support

  • I forgot the answer to my security question, I tried to update these answers, but to update them also, I must first answers old issue of security which I forgot how can I update and change my security question and the answers?

    I forgot the answer to my security question, I tried to update these answers, but to update them also, I must first answers old issue of security which I forgot how can I update and change my security question and the answers

    ?

    You must ask security team account Apple to reset your security questions. To contact them, click here and choose a method; If this page does not list one for your country or if you are unable to call, complete and submit this form.

    (143315)

  • How many slots for DDR2 is in my Satellite M100-221?

    How many slots for ddr2 in my M100-221 notebooks? And where I get instruction to change memory?

    Hello

    Sorry, but I really can't understand you. On the low side in the Middle it is placed memory fixed with a screw cover. Is it so complicated to remove this screw and look inside?

    In any case in your unit there are 2 slots available. Memory upgrade you need not all the manuals. Buy the right compatible memory module, remove the cover and put it in the location empty.

  • How to watch 3D without glasses on Qosmio F750-11R?

    Hello, I know that this question has been asked many times before, however, I can't seem to find a useful answer (related to my laptop series) anywhere.

    Most of the time the answer is to re - install the X-tunes already pre-installed.
    It is not preinstalled. I updated all the drivers and downloaded all of the proposed programmes.

    It doesn't always seem to work.
    I can convert something in 3d, but then it shows just the screen twice vertically.
    I thought that this should be easy (as suggested by the ads and the very useful note packed with the laptop). I'm not a computer genius, but it shouldn't be this hard?

    Can someone please explain to me how to do this?
    In addition to the 3d dvd I would like to play MP4 and. AVI files as well.

    Thank you!

    Hello

    > How to watch 3D without glasses on Qosmio F750-11R?

    First of all its imporntat to know if your Qosmio F750 is equipped with a 15.6 LCD FHD GLASSES FREE 3D.

    Only F750 units with a glasses free 3D LCD supports 3D without extra 3D glasses.

    Find the plug on the page of Toshiba for the Qosmio F750-11R and unfortunately, it seems that the laptop does NOT support free glasses 3D display.
    http://nl.computers.Toshiba-Europe.com/innovation/product/Qosmio-F750-11R/1115695/toshibaShop/false/

    This is also the reason why the X-tune software was not preinstalled on your laptop

  • Re: Qosmio x 770-136 - how to watch movies in 3D using VLC player

    Hello

    I just got a laptop X 770 - 136 Qosmio.
    How do 3d work?

    I have downloaded films to play through VLC.
    Do I have reason to think that the laptop replaces the 3D?
    Mine doesn't seem to work?

    Hi proudmama

    Just one question: did you look in the manual of user preinstalled on your laptop?
    That there are details and interesting information how to watch 3D.

    First, you will need to use a Toshiba VCR, if you want to play the continent content or video 2D 3D video from a DVD of the video file.
    2D content can be transformed using 2Dto3D real-time conversion.

    Toshiba video player is set to the default 2D format by pressing the button 2Dto3D, conversion would be turned on, and you can watch the 2D to 3D content.

    If you want to watch Blue-ray 3D, you must use the WinDVD BD for Toshiba

Maybe you are looking for

  • Why start/programs have a Vista banner rather than win7?

    I upgraded to win7 from Vista Home Premium. I'm always under Vista or win7?

  • Do not see what I type in Yahoo Messenger

    When you use YM we cannot see what we typed or see the answer of who we are IM'ing with. I am not at all computer savy, I've been at this for a month now and im at my wits end on this. I guess you could say he kicked my butt, so I give up tring to fi

  • Can I install an APK file from SD card lollipop?

    Hello world. I want to know if I can install an app from my SD card to the phone in lollipop. In other words if I receive or have an APK on my SD card, can I install it on my phone if I use Lollipop? KIT KAT I can install any file APK from the SD car

  • Activity of the network and CPU utilization

    Hello I am using windows vista 64-bit edition. Recently I noticed it was a network activity of 2.5% during the period of idle. and when I use internet the % increases. I have no other significant problems with my PC. When I add a column (BytesRecvd)

  • Dual boot XP and Vista

    I have vista sp2, I have an update of XP, I also have Win 98, then I install XP and still have Vista? If I can't, I could just wipe the drive and just install XP, I try to get the old game ' keeper dungoen 1' work and I'm having NO luck with vista, a