Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 14:44, 29 June 2007.

Midlet basic lifecycle and states

From Forum Nokia Wiki

When a user clicks on the MIDlet icon the MIDlet begins execution.Following are the steps that follow---
1. The AMS first calls the zero-argument constructor to create a new instance of the MIDlet.
2. When the constructor returns, the AMS places the MIDlet in the Paused state.
3. To shift the MIDlet to the Active state the AMS calls the midlet.startApp() method.

The startApp is the method where the other code for the midlet to
operate i mean whatever the application is meant for does..like in a typical game a thread is started and the game loop begins.

4. A transition from the Active state back to the Paused state occurs whenever the AMS calls midlet.pauseApp().
5. The MIDlet may shift from Paused to Active or back any number of times during its execution, each time on a call to startApp() or pauseApp().

Usually pauseApp gets called when there is a device interrupt like call on a device or maybe u inserted the charger plug ..etc. Note. pauseApp is never called by the system on Nokia developer platforms.

The basic states can be summarized from the figure below. Image:App-States.gif

6. The MIDlet may enter the Destroyed state from either Paused or Active, on a call to midlet.destroyApp().
7. A MIDlet may voluntarily enter the Paused state by calling midlet.notifyPaused().
8. In a similar fashion, it may call midlet.notifyDestroyed() to inform the AMS that the MIDlet can now be considered Destroyed. The destroyApp() method is actually called with a boolean argument. If this boolean is true, the MIDlet will be in the Destroyed state when destroyApp() returns. If this boolean is false, however, the MIDlet can request not to enter the Destroyed state by throwing a MIDletStateChangeException.
9. Finally, a call to midlet.resumeRequest() will tell the AMS that the MIDlet is interested in entering the Active state. While it's idle in most ways, a MIDlet in the Paused state may handle asynchronous events such as timers and callbacks.

For more details click here

Related Discussions
Thread Thread Starter Forum Replies Last Post
sending sms using visual basic??? nirmit_ic PC Suite API and PC Connectivity SDK 1 2007-07-16 20:20
Want to send SMS from Nokia 3230 in VB6 Protap General Messaging 7 2007-04-29 19:46
MIDlet call..Urgent.. snehalpatil Mobile Java General 3 2008-02-21 12:22
是否有S60 3rd FP1 SDK中例子的说明,哪怕是简单的 yinyz Symbian 6 2007-09-05 16:29
Setting Reminders dattuit Mobile Java General 0 2003-04-04 09:56
 
Powered by MediaWiki