Magazine
 
Java ME
 
The startApp() method is called by the application manager as soon as the MIDlet is started. It contains statements that are executed each time the application begins execution.

pauseApp()

The pauseApp() method is called before the application manager temporarily stops the MIDlet. The application manager restarts the MIDlet by recalling the startApp() method.

destroyApp()

The destroyApp() method is called prior to the termination of the MIDlet by the application manager.

Lets see the basic shell of a MIDlet through a example.

In our example, the MIDlet class called BasicMIDletShell extends the MIDlet class. Any name can be used for a class as long as it conforms to the Java class naming conventions.

public class BasicMIDletShell extends MIDlet
{
public void startApp()
{}
public void pauseApp()
{}
public void destroyApp( boolean
unconditional)
{}

MIDP 2 Game Classes

The popularity of Java platform ME and game development has sprouted several carrier and manufacturer specific custom classes supporting the game development. However, the main problem with this is portability, e.g. using Siemens Sprite class make

  it difficult for the user to port the game to a Nokia handset, as it requires to re-implement the sprite class.

Release of MIDP 2.0 removed some of these common problems occurred with the game portability. MIDP 2.0 is released with the introduction of five new classes:

_ GameCanvas

_ Sprite

_ Layer

_ LayerManager

_ TiledLayer


With these new game classes the user’s code potentially become a lot easier issue and now you do not have to implement the custom classes such as Sprite. These classes are now a part of the underlying Java environment on
the mobile handset.
Nov 2007 | Java Jazz Up |15
 
previous
index
next
 
View All Topics
All Pages of this Issue
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69   Download PDF