java left logo
java middle logo
java right logo
 

Home arrow Java ME Tips
 
 
Main Menu
Home
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog




Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews


Statistics
Registered Users: 3894
Java SE Tips: 614
Java ME Tips: 202
Java EE Tips: 183
Other API Tips: 779
Java Applications: 298
Java Libraries: 209
Java Games: 16
Book Reviews:
 
 
 
Launching a Midlet from another Midlet E-mail
User Rating: / 26
PoorBest 

There are two entities in the MIDP Specification of J2ME: a MIDletSuite, and a MIDlet. A MIDletSuite is a collection of MIDlets and resources bundled together in a compressed JAR file (which, by the way, does not have to be kept after the MIDletSuite is "installed" on a device). MIDlets are the launchable entities within the suite.

For security reasons, it is assumed that MIDlets within a MIDletSuite are packaged together for a reason and should be able to interoperate. What's implied here is that the MIDlets share a name space; in other words, each MIDlet in the MidletSuite can "see" one another. Because they can see one another, they can launch one another (Class.forName metaphor).

In contrast, one MIDletSuite cannot launch another MIDletSuite. That's because they do not share name spaces. Since the CLDC+MIDP does not have a security manager (too big and complex for small devices), the MIDP expert group felt it more prudent to limit the interaction of downloaded applications to those that are packaged together by the provider.

PushRegistry.registerAlarm() register a time to launch a new application. PushRegistry class is a part of MIDP 2.0 standard. The only limitation is that some of the host device do not support Push Registry alarms.At the time of implementation it will throw ConnectionNotFoundException if the host device do not support the above method.

The method below will launch MIDLET from current MIDLET suite at the registered time.

try {

     // mainApp is a midlet class
     long previous = PushRegistry.registerAlarm("mainApp",launchtime);

catch java.lang.ClassNotFoundException cnf ) {

     System.out.println"mainApp: Class not Found" );

catch javax.microedition.io.ConnectionNotFoundException connnf ) {

     System.out.println"mainApp: Connection Not Found" );
}


 Related Tips

 
< Prev   Next >

Page 1 of 0 ( 0 comments )

You can share your information about this topic using the form below!

Please do not post your questions with this form! Thanks.


Name (required)


E-Mail (required)

Your email will not be displayed on the site - only to our administrator
Homepage(optional)



Comment Enable HTML code : Yes No



 
       
         
     
 
 
 
   
 
 
java bottom left
java bottom middle
java bottom right
RSS 0.91 FeedRSS 1.0 FeedRSS 2.0 FeedATOM FeedOPML Feed

Home - About Us - Privacy Policy
Copyright 2005 - 2008 www.java-tips.org
Java is a trademark of Sun Microsystems, Inc.