1

I want to use the Push registry to start the midlet at a specified time. When I run the app, even when the time is exceeded the midlet is not started..

public void startApp() {

    System.out.println( "AlarmMIDlet: startApp" );

    try {
        Date    now = new Date();
        long    previous;
                    String cn = this.getClass().getName();
                    System.out.println("Class name : "+cn);
        previous    = PushRegistry.registerAlarm( "hello.AlarmMIDlet", now.getTime() + 600 );

        System.out.println( "AlarmMIDlet: time of previous alarm: " + previous );
    } catch ( java.lang.ClassNotFoundException cnf ) {
        System.out.println( "AlarmMIDlet: Class not Found" );
    } catch ( javax.microedition.io.ConnectionNotFoundException connnf ) {
        System.out.println( "AlarmMIDlet: Connection Not Found" );
    }

    System.out.println( "AlarmMIDlet: startApp: return" );

    notifyDestroyed();
}

Anyone has ever faced a similar problem?How to sort this out?

Manish Basdeo
  • 6,139
  • 22
  • 68
  • 102

1 Answers1

1

To be fair I never used PushRegistry, but from what I read you need to schedule time alarm on the middlet destroyApp(). Have look at this article, scroll down for Registering a Timer Alarm

peter_budo
  • 1,748
  • 4
  • 26
  • 48