views:

980

answers:

3

I been looking around and at sources like this one they say that a Midlet can invoke another if they are in the same suite, or if they are in the same namespace and in the same jar file.

I do not understand what a Midlet-Suite is?

Also after searching through the web I did not find any documentation or code examples for One Midlet invoking another Midlet.

+3  A: 

A MIDlet suite is basically the JAR file. There are many J2ME applications that contain several MIDlet classes in the jar, see some of Sun's examples that come with WTK.

Edit: There's an example called MMAPIDemos that comes with sun's WTK that uses 3 MIDlets in one suite.

Orr Matarasso
+1  A: 

You can try PushRegistry as a more generic way. You should be able to launch MIDlets from other suites as well. Try this link for more information.

Szere Dyeri
Thanks, Can the Invoking Midlet destroy itself as soon as It invokes the new Midlet?
Kevin Boyd
There is no such requirement. But most KVMs only support 1 active midlet at a time. That probably means your first midlet will go into paused state.
Szere Dyeri
Won,t the paused midlet be using up precious resources of the mobile, I wanted to destroy the Midlet to free up resources.
Kevin Boyd
I guess it will still keep resources. But once you launch another midlet, using any method same thing will happen. Maybe one thing you can do is. 1. Register a timer for midlet A. 2. Launch midlet B. 3. Register a timer for midlet B. 4. first timer activates A, kill A. 5. Second timer will activate B and you can keep going from there on. I hope this helps somehow.
Szere Dyeri
+1  A: 

The other replies are pretty much taking care of your questions about MIDlet Suites but I would suggest reading the MIDP specification to get the information first-hand:

http://www.jcp.org/en/jsr/detail?id=118

On recent phones (Series60 5th edition from Nokia Sony-Ericsson and Samsung, other Sony-ericsson phones), the Content Handling API (CHAPI) is supported for MIDlet-to-MIdlet invocation. That's JSR-211. You can read the specification for that here:

http://www.jcp.org/en/jsr/detail?id=211

The latest version of the Nokia Java Developers Library will contain more explanation:

http://www.forum.nokia.com/Tools%5FDocs%5Fand%5FCode/Documentation/Java/

The latest JavaME SDK will contain CHAPI code examples:

http://java.sun.com/javame/downloads/sdk30.jsp

Edit: CHAPI is also available on non-Symbian Nokia phones from Series 40 5th Edition, Feature Pack 1 onward, according to the Nokia Java Developers Library. You can find which nokia phone is running which version of Series40 at:

http://www.forum.nokia.com/devices/matrix%5Fall%5F1.html

QuickRecipesOnSymbianOS
Thanks, Can I implement this on older phones like the Nokia S40 series?
Kevin Boyd