Search code examples
java-meinstallationinitializationmidlet

Detect if the MIDlet is installing or running for the first time


I'm using J2ME SDK 3.0 and J2ME Polish and i would like to know if there's any event that is called when the user installs the application or when the MIDlet is running for the first time.


Solution

  • There is no specific "first run" event. However, when the MIDlet starts, the system will invoke MIDlet.startApp(). You can implement your own "first run" detection by creating a RecordStore and saving some information in it. If the RecordStore does not exist, then it's first run. If it does, then you have run the MIDlet before.