×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    93

    Thumbs up simple Push Registry program issue

    I have tried a simple Push Registry program. I am using Lwuit components also.
    My program compile and Run properly in Netbeans. Also I have tested in real device(2730) also. when click on Exit in my program, message shows , "Allow program when it is notified" and exit the Application. Then push registry not set After 30 seconds.

    what is the problem in my program.Plz clear my issue.

    My coding is below:

    import com.sun.lwuit.Command;
    import com.sun.lwuit.Dialog;
    import com.sun.lwuit.Display;
    import com.sun.lwuit.Form;
    import com.sun.lwuit.Label;
    import com.sun.lwuit.events.ActionEvent;
    import java.util.Date;
    import javax.microedition.io.ConnectionNotFoundException;
    import javax.microedition.io.PushRegistry;
    import javax.microedition.midlet.*;

    /**
    * @author WELCOME
    */
    public class Push extends MIDlet {
    private Form f;
    long ll,t;

    public void startApp() {
    Display.init(this);
    f=new Form("Push Registry");

    f.addCommand(new Command("Exit"){public void actionPerformed(ActionEvent evt){
    final Dialog d=new Dialog("Exit");
    Label l=new Label("Want to Exit");
    d.addComponent(l);
    d.addCommand(new Command("Yes"){
    private int l1;

    public void actionPerformed(ActionEvent evt){
    Date d=new Date();
    long ll=d.getTime();
    long t=l1+30000;
    try {
    PushRegistry.registerAlarm("Push", t);
    } catch (ClassNotFoundException ex) {
    ex.printStackTrace();
    } catch (ConnectionNotFoundException ex) {
    ex.printStackTrace();
    }
    notifyDestroyed();
    destroyApp(true);}});
    d.addCommand(new Command("No"){public void actionPerformed(ActionEvent evt){d.dispose();}});
    d.show();
    }});
    f.show();
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }

    }

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: simple Push Registry program issue

    One oddity I noticed is that you have two similar looking variables (ll and l1). You get the current timestamp into ll and set the wakeup time with l1.

    Hartti

  3. #3
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    93

    Thumbs up Re: simple Push Registry program issue

    Thank you Hartti...i have corrected my mistake you indicated....My push registry work properly.........

    Also i have another doubt......I want this push registry Remainder will set in between 11 am to 3 pm alone.. If i open and exit the application other than 11 am to 3 pm.....the pushregistry should not show remainder to launch application......what i want to do....Plz clear my doubt.....

  4. #4
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: simple Push Registry program issue

    You can find out the time of the day as well, for example using Date.toString()
    http://library.forum.nokia.com/topic...util/Date.html

    And then you can create whatever logic you want around that piece of information

    Hartti

Similar Threads

  1. Push Registry on S60 simple question ...
    By loicmormont in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2010-09-17, 13:02
  2. Bluetooth push registry issue on N79
    By logos01srl in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2010-04-23, 13:00
  3. 2630 jsr 82 push registry issue
    By logos01srl in forum Bluetooth Technology
    Replies: 0
    Last Post: 2009-04-27, 19:17
  4. Push Registry alarm issue...
    By kumara1423 in forum Mobile Java General
    Replies: 2
    Last Post: 2007-05-23, 05:06
  5. Replies: 2
    Last Post: 2006-11-25, 13:58

Posting Permissions

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