Developing midlets
Upcoming SlideShare
Loading in...5
×
 

Developing midlets

on

  • 302 views

MIDlet Lifecycle

MIDlet Lifecycle

Statistics

Views

Total Views
302
Views on SlideShare
302
Embed Views
0

Actions

Likes
0
Downloads
3
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Developing midlets Developing midlets Document Transcript

  • Java Mobile ProgrammingAfrica Nazarene University,Meru CampusMay Trimester, 2013Raphael Wanjiku,Computer Science Department
  • Developing MidletsMidlet- A java application that can run on any MIDP device.We will develop our applications using the Sun’s J2ME Wireless Toolkit.Hello world MidletSteps1. Click on File ->New Project ->Categories(Java ME SDK) ->MIDP Application2. Name the project as HelloApp and do not deselect the checkboxes.3. Select Device(for Emulation)4. Select device configuration as CLDC-1.05. Select Device profiles as MIDP-2.0 and click finish.1.2.3.4.7.5...6....8.
  • 1. These imports the necessary classes required for use by the Midlet2. Declaration of variables to be used in the Midlet3. Creation of the constructor HelloMidlet().This is where objects are instantiated.4. Instantiation of the different classes objects.5. Implementation of the setCommandListener () method on the command object.6. Setting of the displayable object upon call of the startApp().7. Shows the class scope. This is shown by the curly braces.8. Implementation of the commandAction().This is where one specifies which commandnavigates where.Midlet LifecycleA Midlet’s lifecycle is reflected in the methods and behaviour of the MIDlet class. A MIDletgoes through the following states:a) When a MIDlet is run, the constructor is run creating an instance. It is in the pausedstate.b) The MIDlet then enters the Active state when the startApp () is called.c) While the MIDlet is still in the active state, its execution can be suspended enteringinto paused state. This is effected by calling notifyPaused ().d) While in the paused state, it can resume by calling startApp() to put it back into theactive state.e) The MIDlet can be terminated by calling the destroyApp() or auto-destroy by callingnotifyDestroyed().Code Explanation View slide