简体   繁体   English

J2ME和手机

[英]J2ME and mobile phones

can i write a MIDlet that stays "resident" like an agenda, that alarms when a certain event will occur( in other words, the MIDlet API allows the developer write a application that stays running in background)? 我可以编写一个像议程一样保持“常驻”状态的MIDlet,该MIDlet在某个事件将发生时发出警报(换句话说,MIDlet API允许开发人员编写一个在后台运行的应用程序)? Within a MIDlet, can i use the vibratory alarm of the cellphone? 在MIDlet中,我可以使用手机的振动警报吗?

There's no clean way to background a J2ME app that works generically across all phones. 没有一种干净的方法可以使可在所有电话上正常工作的J2ME应用程序后台化。 In most cases phones can only run one app at a time, so even if your app were backgrounded, if another app starts, yours could well get terminated. 在大多数情况下,手机一次只能运行一个应用程序,因此,即使您的应用程序后台运行,如果另一个应用程序启动,您的应用程序也很可能被终止。

Having said that, you can for some Sony Ericsson and non-old Nokias at least hide you app with something like this in your MIDlet subclass: 话虽如此,对于某些索尼爱立信和非老诺基亚来说,您至少可以在MIDlet子类中使用以下内容将您的应用隐藏:

Display.getDisplay( this ).setCurrent( null );

On your other question about vibration alarms: yes, you can use the Display.vibrate() method: 关于振动警报的其他问题:是的,可以使用Display.vibrate()方法:

Display.getDisplay( this ).vibrate( duration );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM