×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Feb 2011
    Posts
    73

    problem in pushRegistry.registerAlarm

    Hi, I want in my app after a few miniutes runs automatically and shows a Canvas type message, my problem is what is the condition for the midlet when it starts automatically shows the Canvas type message and when it starts automatically, it shows something else? I appreciate if anyone could answer my question.

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: problem in pushRegistry.registerAlarm

    Hi elenora,

    So if I understand correctly, you need to display a Canvas Object after a certain period of time from within your already running midlet, right?
    Why not, use the Timer and TimerTask classes for that purpose?
    You can take a look at the Alert example here:

    http://www.developer.nokia.com/Commu...arm_in_Java_ME

    and modify it accordingly so that instead of the Alert, you get your Canvas painted after a certain period of time has elapsed.

    More information regarding the Timer and TimerTask classes can be found here:
    http://library.developer.nokia.com/i...til/Timer.html
    http://library.developer.nokia.com/i...TimerTask.html

  3. #3
    Regular Contributor
    Join Date
    Feb 2011
    Posts
    73

    Red face Re: problem in pushRegistry.registerAlarm

    Hi, thank you very much, but I want that when i'm out of running Midlet it shows a Canvas type message in a time which user entered in the app, but i don't know How can I differ between when the app starts automatically shows the message and when it starts manually shows another thing, I don't know what condition in the startApp() method should I use to differ betwwen them?! Could you show me How can I differ between them?

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: problem in pushRegistry.registerAlarm

    In that case you would need to Register a time to launch the specific application. Have you looked at the PushRegistry examples and the information in the Library? Here are a few links:

    http://www.developer.nokia.com/Commu...try_in_Java_ME
    http://library.developer.nokia.com/i...hRegistry.html

    Then you would need to store the information of whether the application is set to be launched automatically or not, to the Record Management System. You could store a simple String to RMS with different value for manual and automatic launch. Each time the application starts, it should access the Record Management System and check the value of the String in a given Record with a given record id. You can use the example below to learn how to manage the RMS:

    http://library.developer.nokia.com/i...132B47309.html

    You have to be careful though, as when setting the record, the code in the above example adds a new record and it doesn't modify an existing one.
    So you would need to modify a bit the set method
    from
    rms.addRecord(data, 0, data.length);
    to something like:
    rms.setRecord(1, data, 0, data.length);

    provided that you always set and get the Record with Record ID 1.
    Last edited by skalogir; 2011-10-11 at 14:13.

Similar Threads

  1. PushRegistry and RegisterAlarm in QT?
    By anton_duca in forum [Archived] Qt Mobility Project
    Replies: 1
    Last Post: 2010-12-19, 15:01
  2. J2ME PushRegistry.registerAlarm problem
    By kenichi24 in forum Mobile Java General
    Replies: 1
    Last Post: 2010-08-29, 06:19
  3. PushRegistry.registerAlarm
    By kamalinfo2k2@yahoo.com in forum Mobile Java General
    Replies: 1
    Last Post: 2006-11-17, 11:17
  4. PushRegistry.RegisterAlarm() -problem
    By henkkapa in forum Mobile Java General
    Replies: 7
    Last Post: 2006-03-02, 23:28
  5. PushRegistry.registerAlarm
    By nstamps in forum Mobile Java General
    Replies: 0
    Last Post: 2004-04-13, 15:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×