user1797691
user1797691

Reputation:

how to run application even it is closed Blackberry

how can i make an alarm application in Blackberry?

this means i have a time picker where user selects time, i then save that time and show a dialog when the system time matches with that time.

i have used RealtimeClockListener and the method clockUpdated() will give me time at every minute. now when i closed the app that method is also closed

i want to execute that method if the app is closed or not

public void clockUpdated() 
{
    int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
    int minute = Calendar.getInstance().get(Calendar.MINUTE);
    //System.out.println("----"+Calendar.getInstance().get(Calendar.AM_PM));
    String am = ""+Calendar.getInstance().get(Calendar.AM_PM); 
}

Upvotes: 1

Views: 67

Answers (1)

Adwiv
Adwiv

Reputation: 1266

You will have to use an alternate entry point and start a background application on device startup for listening to the RealTimeClockListener event. Use persistence to store and share the alarm time data.

See Running in the Background Part 1 and Part 2 and Creating an Always-On Experience for more details.

Upvotes: 3

Related Questions