blackberry如何安排应用程序
在黑莓手机中,我需要能够在一天中的特定时间启动和关闭应用程序。假设在上午8:00开始,然后在下午5:00关闭应用程序。在blackberry中是否可以以这种方式安排应用程序 我正在寻找的功能类似于Unix或Windows调度器中的cron。blackberry如何安排应用程序,blackberry,scheduled-tasks,Blackberry,Scheduled Tasks,在黑莓手机中,我需要能够在一天中的特定时间启动和关闭应用程序。假设在上午8:00开始,然后在下午5:00关闭应用程序。在blackberry中是否可以以这种方式安排应用程序 我正在寻找的功能类似于Unix或Windows调度器中的cron。 我不是一个开发者。是否有提供类似于cron或windows scheduler功能的应用程序?您可以使用ApplicationManager的功能计划应用程序启动: ApplicationDescriptor descriptor = Application
我不是一个开发者。是否有提供类似于cron或windows scheduler功能的应用程序?您可以使用ApplicationManager的功能计划应用程序启动:
ApplicationDescriptor descriptor = ApplicationDescriptor.getCurrentApplicationDescriptor();
ApplicationManager manager = ApplicationManager.getApplicationManager();
// Compute the time when it need to be scheduled
long toberuntime;
manager.scheduleApplication(descriptor ,toberuntime,true);
还应注意日期和时区的更改,如前所述这是另一个每分钟调用runnable的示例 请注意,您必须为任务设置一个备用条目,并确保它在设备启动时启动。应用程序管理器负责安排作业 在本例中,每次调用背景aep时,设备都会振动
public static void main(String[] args)
{
// Create a new instance of the application and make the currently
// running thread the application's event dispatch thread.
if(args != null && args.length > 0 && "ticker".equals(args[0])){
scheduleUpdate();
}else{
UIapp theApp = new UIapp ();
theApp.enterEventDispatcher();
}
}
private static void scheduleUpdate() {
// TODO Auto-generated method stub
Alert.startVibrate(2550);
ApplicationDescriptor current = ApplicationDescriptor.currentApplicationDescriptor();
current.setPowerOnBehavior(ApplicationDescriptor.DO_NOT_POWER_ON);
ApplicationManager manager = ApplicationManager.getApplicationManager();
//check if device has booted and is ready..
if(!manager.inStartup()){
try{
TickerUpdateService tickerUpdater = new TickerUpdateService(endpointURL);
tickerUpdater.start();
}catch(Exception Ex){
System.out.println(Ex.getMessage());
}
}
manager.scheduleApplication(current, System.currentTimeMillis() + 60000, true);
}
通过在stackoverflow中进行搜索,我发现:;但我不是一个开发者。有没有提供类似于cron或windows scheduler功能的应用程序?我做了一些搜索,但没有立即找到。如果你能等到这个周末,我可以为你开发一个。如果您觉得合适,请让我了解有关应用程序用例的更多详细信息。我一定会让你知道,当我做了;但是没有承诺!哇,真大方。我希望你能指导我完成这个过程。我已经下载了jde。下一个问题是如何识别应用程序名称。换句话说,getCurrentApplicationDescriptor引用了什么?@user1074593当你说“我不是开发人员”时,我们应该在什么上下文中回答你的问题?StackOverflow是一个供开发者提问和回答问题的网站。如果这样的应用程序不存在,而编写一段简单的代码是唯一的选择,我愿意走这条路去。如果不可能,那么说出来,我会接受。没必要在这件事上胡闹。