One thing which has been bugging me about the mSOA Reference Architecture I'm working on for Sierra (aka Java CAPS 5.2) is that so far, it's been really tough for one MIDlet to invoke another.
We have one main controller MIDlet (the "Service Manager" or "Application Manager") which gets a list of viable applications from the backend servers -- Java CAPS, Directory Server and so on. The user should then be able to launch any one of the MIDlets at will.
The J2ME security model doesn't want you doing that.
Until now, we've been making do with everything being packaged into a single giant MIDlet. Some of the problems with this are that:
- It's not modular. It's one giant application. Ugh.
- No separation between MIDlets. All UI code will be in a single class file. If you have more than one developer, they'll be treading on each other's toes all the time.
- The flow design in the NetBeans mobility pack becomes impossible to follow after just one MIDlet. If you want to see how bad it is, this screenshot should give you an idea what it's like after just one application.
I don't claim to be a J2ME expert so it's taken a lot of searching for a portable way of doing this. The answer seems to be with the PushRegistry API which is part of the MIDP 2.0 specification. The MIDlets still need to be part of the same suite, which means they're still packaged into the same jar file and you need to use OTA (Over The Air) provisioning to make it work.
But work it does... take a look at the
this project zip. It was built using NB 551 with the mobility pack and
WTK 2.5.2. Run the Hello MIDlet in the emulator and when you press OK, it should then launch the Goodbye MIDlet.