如何停止j2me的midlet的执行?
如何停止j2me midlet的执行一段特定的时间?
How to stop the execution of midlet of j2me for a specific amount of time ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何停止j2me midlet的执行一段特定的时间?
How to stop the execution of midlet of j2me for a specific amount of time ?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
MIDlet的生命周期完全由驻留在手机上的AMS软件控制。因此,任何与 MIDlet 执行相关的功能都必须向 AMS 软件请求。对于您所描述的特定情况,PushRegistry 支持。
您可以通过指定 MIDlet 的完全限定类名以及应用程序必须再次启动的时间(以毫秒为单位)来使用 registerAlarm。请注意,这是绝对时间。它的工作方式如下:
注意:这是一个受保护的 API,应用程序可能必须签名才能使用它。大多数手机都会有安全提示;但很少有人不这样做。这取决于制造商和运营商制定的政策。因此,正确捕获安全异常;否则你会对应用程序默默地失败感到困惑。
参考文献:
非常彻底PushRegistry论文
[1]: http://download.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/javax/microedition/io/PushRegistry.html#registerAlarm( java.lang.String, long)
MIDlet's life cycle is completely controlled by AMS software resident on the phone. So, any facility that is related to execution of MIDlet must be requested from AMS software. For the particular situation you are describing is supported by Push Registry.
You could use registerAlarm by specifying the fully qualified class name of the MIDlet and time (in milli seconds) at which the application must be started again. Note that this is absolute time. The way it works is as follows:
Note: This is a protected API and it is possible that application MUST be signed in order to make use of it. Most of the phones would allow with a security prompt; however there are few that don't. It depends on the policy set by manufacturer and operator. So, catch security exceptions properly; otherwise you will be puzzled that app fails silently.
References:
A very thorough treatise of Push Registry
[1]: http://download.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/javax/microedition/io/PushRegistry.html#registerAlarm(java.lang.String, long)