Skip to main content

Firing up another midlet from running midlet

5 replies [Last post]
codingvista
Offline
Joined: 2008-07-29
Points: 0

Hi

Hope this is the right place to post this

I'm new to the whole Java world - been a .NET dev for a few yaers though :)

I'm playing about with J2ME and I'm trying to write a little app where the menu provides a link to another app - when clicked the other app fires up in front of the running app.

In NetBeans I've added the JAR/JAD to the resources folder but to be honest - I'm clutching at straws and have no idea what I'm doing.

I've tried platformRequest - but that has unexpected results.

w://

Message was edited by: codingvista

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sfitzjava
Offline
Joined: 2003-06-15
Points: 0

As with most things JavaME-ish, they don't want you to do that. Anything beyond a game just doesn't seem to be thoroughly designed, or implemented.

The suggestion of pushregistry is an interesting idea, to set an alarm to launch the other midlet, however the alarm granularity is 1min from what I have read.
Also you could have your other apps setup with pushregistry entries and then from your app send out an SMS to launch them. (SMS charges will apply) 8-( However maybe using a datagram instead of SMS would work and without the extra charges.

When (if) midp3 or MSA become common place. (don't hold your breath) You can do something like CHAPI (JSR-211).

-Shawn

codingvista
Offline
Joined: 2008-07-29
Points: 0

Hi guys - the registry idea might well work - using an alarm - as I dont have access the code of the apps I'm trying to fire up - sending a datagram or other would require changing the code of the target MIDlet.

The actual app I'm trying to fire up is in the form of JAR/JAD files.

How can I add these to the project to reference as the target MIDlet? or is this not possible? Does the target for the registry push alarm need to be a MIDlet class that is part of the same codebase?

I'm soooo close to getting this working!

w://

davjoh
Offline
Joined: 2007-07-18
Points: 0

Thanks for clarifying what you're trying to do....

You can try doing Push Registration by modifying the JAD file to add a MIDlet-Push attribute, thus not having to modify any of your pre-packaged application code/binaries. The phone's Application Management System should then register the push connection to fire up your pushed MIDlet. The timer could work, but is it possible to use a socket connection to loopback to a different port to initiate a push? I have a feeling trying to go to localhost:xxxx might not work though.

I've not tried it myself, but I'm not sure how this would affect your 'root' MIDlet. Perhaps the push causes your running MIDlet to go into a paused state.

If you get any success, do let us know!

armand dos santos

As mentioned above, you can do that using JSR211. It is already available on
some phones (SonyEricsson JP-8 and Nokia S40 5th edition phones, I don't
know about the other manufacturers).

Armand

On Wed, Jul 30, 2008 at 8:32 AM, wrote:

> Thanks for clarifying what you're trying to do....
>
> You can try doing Push Registration by modifying the JAD file to add a
> MIDlet-Push attribute, thus not having to modify any of your pre-packaged
> application code/binaries. The phone's Application Management System should
> then register the push connection to fire up your pushed MIDlet. The timer
> could work, but is it possible to use a socket connection to loopback to a
> different port to initiate a push? I have a feeling trying to go to
> localhost:xxxx might not work though.
>
> I've not tried it myself, but I'm not sure how this would affect your
> 'root' MIDlet. Perhaps the push causes your running MIDlet to go into a
> paused state.
>
> If you get any success, do let us know!
> [Message sent by forum member 'davjoh' (davjoh)]
>
> http://forums.java.net/jive/thread.jspa?messageID=290271
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the
> body
> of the message "signoff KVM-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".
[att1.html]

davjoh
Offline
Joined: 2007-07-18
Points: 0

You could take a look at the MIDP 2.0 Push Registry to see if you can use that to initiate one MIDlet from another.