How do I know if an application is initiated by the user or automatically?

Working on an application (midlet right now) that we want to "wake up" and synchronize data periodically.  Is there a way to say who launched the midlet?  (launch for instance initiated by the user or an automatic launch via ApplicationManager.scheduleApplication or PushRegistry.registerAlarm?)

For example, if it is a launch that is initiated by the user, we don't want to run an automatic synchronization.

Thank you!

When you register your alarm, you need to store also the time you wait for the alarm goes off in the RecordStore (since it is a nonvolatile persistent storage). When lanceApp is running, simply compare the current time to the alarm time in your RecordStore. If the alarm time is exceeded, you know that you were auto began.

One thing to look out for good: we have observed that the Blackberry rounds all PushRegistry alarms to the minute. In addition, we found that the alarms does not run if you remove the battery, the power cycle or lock the keyboard. RealtimeClockListener may be a better way to go, and Yes you can still use it in a MIDlet despite what the documentation (at least on the phones I tried). Just call Application.getApplication () .addRealtimeClockListener (clockListener) in your midlet.

Tags: BlackBerry Developers

Similar Questions

  • How do I know if a call is disconnected by the user or by the appellant?

    When there is an incoming call, the phone user can log out by clicking on the red button, or it can be cut by the appellant. I must say that out of these two types.

    But no matter how the call is interrupted, the system continues to produce a callDisconnected event.

    Also, I tried to save an event key listener to monitor the events of the red button. But as the system have consumed the event, the system will not send this event of red button at my request.

    Do you have an idea how know if a call to imcomming is disconnected by the user or by the appellant?

    I tried, although the keydown event of the red button has been consumed by the system, but the keyup event is still distributed, so that the application can listen to the event keyup to know if the call is interrupted by the appellant or by user.

  • How will I know whether to install any program in the 64-bit or 32-bit section in Vista?

    original title: where to install?

    How can I know weather to install any program in the 64-bit or 32-bit section?

    Hello DaphneanEpiphany,

    The application that you are installing will sort it out for you. Unless the software is told explicitly 64-bit in the box, you can be assured that the software will be 32-bit.

    If you are running a copy of Windows Vista (or 7) 64-bit operating system will install the software in the right folder so I don't worry about this.

    This forum post is my own opinion and does not necessarily reflect the opinion or the opinion of Microsoft, its employees or other MVPS.

    John Barnett MVP: Windows XP Expert associated with: Windows Expert - consumer: www.winuser.co.uk | vistasupport.mvps.org | xphelpandsupport.mvps.org | www.silversurfer-Guide.com

  • How do I know if ESXi 4 OS installed on the local hard drive or SAN?

    Hello

    As above, how can I know if ESXi 4 OS installed on the local hard drive or SAN? average is ESXi SAN hard drive boot?

    Thank you

    The output looks like that ESXi is installed on the local disk (vmhba0).

        1 root     root       146778685440 Jul  8 11:16 mpx.vmhba0:C0:T0:L0
        119 917504 -rw-------    1 root     root          939524096 Jul  8 11:16 mpx.vmhba0:C0:T0:L0:1
        121 4193280 -rw-------    1 root     root         4293918720 Jul  8 11:16 mpx.vmhba0:C0:T0:L0:2
        123 138223680 -rw-------    1 root     root       141541048320 Jul  8 11:16 mpx.vmhba0:C0:T0:L0:3
        125 4080 -rw-------    1 root     root            4177920 Jul  8 11:16 mpx.vmhba0:C0:T0:L0:4
        127 255984 -rw-------    1 root     root          262127616 Jul  8 11:16 mpx.vmhba0:C0:T0:L0:5
        129 255984 -rw-------    1 root     root          262127616 Jul  8 11:16 mpx.vmhba0:C0:T0:L0:6
        131 112624 -rw-------    1 root     root          115326976 Jul  8 11:16 mpx.vmhba0:C0:T0:L0:7
        133 292848 -rw-------    1 root     root          299876352 Jul  8 11:16 mpx.vmhba0:C0:T0:L0:8
    

    Sizes, looks like you are using 2x146GB hard drives in RAID1.

    BTW. ls-lisa and fdisk-lu are two separate commands.

    André

  • Headless Application Crash when closing the user interface

    For some reason, my application without head started crashing whenever the user interface is closed. Here is the stack trace that I get headless application when I close the user interface:

    Thread [1] (STOPPED) (Suspended : Signal : SIGSEGV:Segmentation fault)
        QHostAddressPrivate::clear() at qhostaddress.cpp:293 0x1822926c
        QAbstractSocket::disconnectFromHostImplementation() at qabstractsocket.cpp:2,714 0x18243466
        qt_static_metacall() at moc_qabstractsocket.cpp:154 0x18245fa8
        QAbstractSocket::qt_static_metacall() at moc_qabstractsocket.cpp:140 0x18245fa8
        QMetaMethod::invoke() at qmetaobject.cpp:1,664 0x196a47d8
        QMetaObject::invokeMethod() at qmetaobject.cpp:1,179 0x196a6334
        invokeMethod() at qobjectdefs.h:418 0x182421e0
        QAbstractSocket::disconnectFromHost() at qabstractsocket.cpp:2,609 0x182421e0
        QAbstractSocketPrivate::canReadNotification() at qabstractsocket.cpp:634 0x18244974
        QAbstractSocketEngine::readNotification() at qabstractsocketengine.cpp:168 0x18237a60
        event() at qnativesocketengine.cpp:1,159 0x1824aeba
        QReadNotifier::event() at qnativesocketengine.cpp:1,156 0x1824aeba
        QCoreApplicationPrivate::notify_helper() at qcoreapplication.cpp:1,083 0x1969e00e
        QCoreApplication::notifyInternal() at qcoreapplication.cpp:953 0x1969de60
        sendEvent() at qcoreapplication.h:231 0x196c379e
        QEventDispatcherUNIX::activateSocketNotifiers() at qeventdispatcher_unix.cpp:894 0x196c379e
        QEventDispatcherUNIXPrivate::doSelect() at qeventdispatcher_unix.cpp:291 0x196c4042
        QEventDispatcherUNIX::processEvents() at qeventdispatcher_unix.cpp:936 0x196c42f0
        QEventLoop::processEvents() at qeventloop.cpp:149 0x1969cace
        QEventLoop::exec() at qeventloop.cpp:204 0x1969cd28
        QCoreApplication::exec() at qcoreapplication.cpp:1,225 0x196a0eda
        main() at main.cpp:39 0x10659de4
    

    Now, you will see the entire track, with the exception of the entrance of main(), seems to be part of the loop of events or other system libraries. Anyone happen to know what is happening here or be willing to help?

    Thanks in advance!

    Well, I found a solution for the bug here. I was using sockets to communicate between my headless and requests for benefits and in my slot look for disconnect events in my application without a head, I got this code:

    void disconnected()
    {
        ...
        _socket->close();
        delete _socket;
        ...
    }
    

    I then changed this slot to look something like this, that solved my problem:

    void disconnected()
    {
        ...
        _socket->close();
        _socket->deleteLater();
        ...
    }
    

    My guess is that I tried to remove the plug while he was still waiting to be delivered to her events. Using deleteLater(), the event loop is responsible for the removal of the plug once all the events have been delivered, preventing the application from crashing.

  • How will I know if I am being charged for the use of data on the mini2 ipad

    How will I know if I am to be charged or billed for usage on my ipad mini data 2?

    Hello

    You can be charged for the use of data on an ipad, if it has a SIM card

    Cellular data.

    If your home wifi is unlimited you will not be charged more.

    Unless your WiFi has a hat of data ie download limit.

    See you soon

    Brian

  • How do I know which programs are constantly running in the background "Vista Home Premium"

    I'm runnning "Vista Home Premium" on my Dell laptop. I use "SUPERAnitiSpyware &"Malwarebytes"at least once a week to get rid of all unwanted programs. What is the best way to investigate and get rid of any program still running. When I boot the hard driver light is solid for a minumtes less than 15 and sparkle even if it is inactive. I also disable all programs in statrup through msconfig. I know enough to find in "Task Manager" processes, but do not know what all processes to make or can I disable. How can I know this stuff?

    I'm runnning "Vista Home Premium" on my Dell laptop. I use "SUPERAnitiSpyware &"Malwarebytes"at least once a week to get rid of all unwanted programs. What is the best way to investigate and get rid of any program still running. When I boot the hard driver light is solid for a minumtes less than 15 and sparkle even if it is inactive. I also disable all programs in statrup through msconfig. I know enough to find in "Task Manager" processes, but do not know what all processes to make or can I disable. How can I know this stuff?

    I highly recommend that you do * not * try disabling all processes.  Although there may be some that you don't need, you'll save time very little by doing this, and you are much more likely to create a serious problem that in order to solve one.

    Also, turning off * everything * automatic start of programs in MSCONFIG is not a good idea. Here is my standard message on the subject:

    First of all, note that you should be in * all * the programs that start automatically, not only with those who are in the system tray. Not all the programs auto-start manifesting by an icon in the status bar.

    On each program, you don't want to automatically start, check its Options to see if she has the choice to not start (make sure that you actually choose to not run, not simply a "don't display the icon" option). Many can easily and better be arrested like that. If this does not work, run MSCONFIG from the start. Run the line and on the Startup tab, uncheck the programs that you do not want to automatically start.

    However, if I were you, I wouldn't do this just for the purpose of the minimum number of running programs. Despite what a lot of people tell you, you should be concerned, not with the way * a lot * of these programs you run, but * that *. Some of them can seriously affect the performance, but others have no effect on performance.

    Don't stop all programs to run willy-nilly. What you need to do is to determine what each program is that its value is for you and what the performance cost is running all the time. You can try searching the Internet and ask questions about the details here.

    Once you have this information, you can make a smart informed decision on what you want to keep and what you want to get rid of.

  • HOW CAN I KNOW IF MY MAIL IS OPENED BY THE RECIPIENT?

    Ideas:

    • HOW CAN I KNOW IF MY EMAIL ADDRESS HAS BEEN OPENED OR READ BY THE RECIPIENT?
    • Error messages
    • Recent changes to your computer
    • What you have already tried to solve the problem

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    Under Tools > Options > receipts > check the request a read receipt > Apply > etc.

    But that also depends on the recipient OKing the process for you to know.
    It is not mandatory for them to do.

    See you soon. Mick Murphy - Microsoft partner

  • How do I know if a loaded SWF file have the source code?

    Hi!, I need to know if a loaded SWF file have the source code. I develop an application running on iOS and admin can upload SWF files that show in the APP, but I must know before show (mobile Adobe AIR APP) or activate (PHP script server), if this SWF file have the source code for no show or enable him not it.,.

    Thank you!

    I have it!

    Only that we need to do is:

    1. If the first tank is:

    F-the swf is uncompressed

    C - compressed with Deflate

    Z - compressed with LZMA

    2. If it is compressed, uncompress it with the right method

    3. search MainTimeline string, if concluded the SWF actionscript so it is not found, the code is not actionscript.

  • How can I reinstall Acrobat if Application Manager indicates that the application is updated, but is absent?

    I uninstalled Acrobat 11 using the uninstall program, and now I can't reinstall because the Application handler specifies that the application is actually updated. The application went from my hard drive and all files of application support disappeared as well. How is - this application manager is considering the application is still installed? Is there a way I can download without the application manager?

    Hello

    I was able to run this: http://www.adobe.com/support/contact/cscleanertool.html

    Needed to ensure that 'ALL' has been selected in the menu drop-down to make sure that Acrobat has shown in the list. Removed and managed to install.

  • Session variable: How do you know where all that is used in the repository?

    Hi all

    We have a requirement where we need to convert a few session variables in variables to repository. For this we need to know where everything is this used in the repository and webcat session variable (including all logical columns use, which all guests use etc.). We tried the utility application, but that did not help. Is there another way to know that? You will really appreciate the pointers on your side.


    Thanks in anticipation,
    Karan

    Hello

    To search for variables used in,

    RPD: Open the RPD-> go to the Tools Menu-> select 'Utilities'-> 'Documentation repository '. This will generate a CSV with associations

    WebCAT: Open the using webcat catalogue Manager-> Tools Menu-> create report - select the desired columns (column Xml include)-> open the rpeort in excel find-> 'Variable' of what you can find the different variables used in the catalogue.

    Rgds,
    DpKa

  • How do I know when a teststand sequence ends with the Simple graphic interface?

    Hello community,

    32-bit Teststand 2014

    32-bit Labview 2015

    I use the version of Labview Teststand user Simple interface.

    Where in the interface can user Simple of Teststand I know when a file sequence is finished running?

    I want to make an event handler when the end of a sequence that will trigger a change in the value of a control.

    Any help would be greatly appreciated.

    Thank you

    Hello

    I believe that the best option for you is with the user interface messages, please refer to this link for more on this topic:

    http://www.NI.com/Tutorial/4532/en/

    Luis G.

  • How do you know that a display object has completed the update of itself

    Hello

    I wonder if there is some event that I had to listen to know that an object has finished the update.

    Once I update a display with some data object, I need to know when it's done everything, including the resizing and initializing... etc.

    I just did a "callLater", but for complex objects, "callLater" does not... using "setTimeout" for 1 second works for these objects complicated... but its my request as much as 1 second slowdown is so slow. In addition, with a timeout is always No... as I have is not a control on objects that could be passed to this class... and maybe in the future there will be a very complex subject that needs more than 1 second to be ready.

    So in short, is it a guaranteed way to know if an object has finished to update itself, so that I can take the next step while being sure about?

    Thank you

    You should be able to use the updateComplete event.

  • How can I connect to Windows XP Pro without using the user name and password?

    I received led optiplex 745 and they all two windows pro installed but I can't open windows pro because I don't have the previous user password.
    How to open windows pro without usin the previous username and password
    Help, please

    Unfortunately, we do not know if you are allowed access to the operating system or someone trying to hack illegally into.

  • How to make a web page which changes each time the user refreshes? Is it possible to Muse?

    Hi, I would like to make a simple site where the main text in the center of the page changes whenever the user refreshes the page in their browser. I guess I'll have to do a master and several pages that are all the same except for changes in the text, but I don't know how to make sure each update goes to another page and not just the home page? Is it still possible in the Muse?

    This is an example of what I'm going: : procatinator:

    Thank you!

    You can't do it with only Muse. Would be probably pretty simple to do with a bit of Javascript. Check the widget directory such that it is possible that someone has made a widget for random content. If not, maybe I'll do one this weekend. ;-)

Maybe you are looking for