Search code examples
blackberryscheduled-tasks

blackberry how to schedule applications


In the blackberry, I need the ability to start and close applications at certain times of the day. Say start at 8:00am and then close the app at 5:00pm. Is it possible to schedule applications this way in blackberry?

The functionality I am looking for would be similar to say cron in Unix or Windows scheduler. I am not a developer. Is there an app which provides functionality similar to cron or windows scheduler? 


Solution

  • You can use ApplicationManager's functionality to schedule the application launch:

    ApplicationDescriptor descriptor = ApplicationDescriptor.getCurrentApplicationDescriptor();
    ApplicationManager manager = ApplicationManager.getApplicationManager();
    
    // Compute the time when it need to be scheduled
    long toberuntime;
    manager.scheduleApplication(descriptor ,toberuntime,true);
    

    Also make note of date and timezone changes, as mentioned here