7

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.

gnat
  • 6,213
  • 108
  • 53
  • 73
Kevin Boyd
  • 12,121
  • 28
  • 86
  • 128

3 Answers3

4

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
  • 771
  • 1
  • 7
  • 17
3

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
  • 14,916
  • 11
  • 39
  • 42
  • Thanks, Can the Invoking Midlet destroy itself as soon as It invokes the new Midlet? – Kevin Boyd Aug 18 '09 at 18:56
  • 2
    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 Aug 18 '09 at 18:59
  • 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 Aug 18 '09 at 19:21
  • 1
    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 Aug 18 '09 at 20:48
3

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_Docs_and_Code/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_all_1.html

michael aubert
  • 6,836
  • 1
  • 16
  • 32