MIDP 1.0では、MIDletを起動する方法が1つしか指定されていません。ユーザーによる手動による起動です。MIDP 2.0仕様では、着信接続またはスケジュールされた時刻に応じてMIDletを起動する2つの新しいメカニズムが追加されています。新しいjavax.microedition.io.PushRegistryクラスは、両方を処理します。
MIDletを起動するためのアラームを使用することができます.PushRegistry.registerAlarm()メソッドは、MIDletを起動するタイマーベースのアラームを登録します.Itは、現在のスイートの midletはJADまたはマニフェストファイルに登録する必要があります)
MIDletのソースコードには以下が含まれます:
...
import javax.microedtion.io.PushRegistry;
あなたのcommandActionメソッドで:
...
String MIDletname = "yourMIDletName";
Date date = new Date();
long currentTime = date.getTime();
long nextTime = currentTime + 2000;
PushRegistry.registerAlarm( MIDletname, nextTime );
...
References:
How can a MIDlet be launched automatically?
The MIDP 2.0 Push Registry