MIDlet Basics - The Lifecycle of a MIDlet Application
1. MIDlet Basic
Cornelius Koo – 2005
cornelius.mellino@gmail.com
2. MIDlet
• MIDlet is an application that is built upon
the MIDlet class.
• MIDlet can communicate with Application
Manager in two-way direction.
Example: Application Manager can pause a MIDlet, while MIDlet
can make a request to be paused by Application Manager.
4. Pause
• Paused: A MIDlet is placed in the paused
state after the constructor has been called,
but prior to being started by the application
manager. Once the MIDlet had been
started, it may alternate between the
Paused and Active states many times
during its lifecycle.
12. Warning !
• Don’t leave the code that persist through
MIDlet lifecycle or code that runs just once
time in the startApp() method because it’ll
be invoked by application manager many
times.
13. Warning !
• When paused or destroyed, MIDlet should
release as many resources as possible.
14. notifyDestroyed()
• MIDlet signals application manager that it’ll
be shutted down.
• Sequence :
- User request to exit
- destroyApp() – releasing resources
- notifyDestroyed() – tell app. manager it’s
safe to shutdown the MIDlet.
20. Reference
• Core J2ME Technology and MIDP. John
W. Muchow. Prentice Hall PTR, 2002.
• Enterprise J2ME: Developing Mobile
Java Applications. Michael Juntao Yuan.
Prentice Hall PTR, 2003.
• J2ME in A Nutshell. Kim Topley. Oreilly,
2002.