Launch a MIDlet From a Text Message

Many people ask how to launch a MIDlet from a text message. Well, you can't automatically start an application (like a push notification) but you can create a link that will let users launch a program with one click.

As you probably know by now, you can create links such as midlet:foobar on your web page that will allow Sprint phones to launch the foobar MIDlet from the microbrowser.

Unfortunately, you can't put links like midlet:foobar into text messages. That would be too easy, wouldn't it?

Instead, you need to bounce the phone off a website. I created a simple HTML page that looks like this:
[code:1:279cb2ba9a]<head>
<meta http-equiv='refresh' content='1;URL=midlet:<?php echo $_SERVER['QUERY_STRING'] ?>' />
</head>[/code:1:279cb2ba9a]Lets call it "midlet.php". Now I can send text messages with links like this:[code:1:279cb2ba9a]http://apgap.com/midlet.php?SendNote[/code:1:279cb2ba9a]
When the user gets that message, they can click on the link. The browser will open but as soon as the page loads the phone gets redirected (automatically) to midlet:SendNote which launches my SendNote application (assuming it's installed on their phone).

It's a hack, but it works surprisingly well. You'll see the browser logos flash by, then the Java logos, then the program starts. Remember you can also use the Muglet extensions to pass data to your application through the URI. This means you can send a link to a phone that contains the name of a MIDlet to launch and some data to pass into it.

Re: Launch a MIDlet From a Text Message

With Sprint MIDP 2.0 support, applications can now listen for sms on specific port. That portion is really easy to implement. What I couldn't find so far is how to send sms to Sprints cell phone's specific port.

Can we do that?
If yes, can you please explain it a little bit?

Thanks,
Amir

Launch a MIDlet From a Text Message

The only way you can send text messages to Sprint phones is through the web form at sprintpcs.com, through the e-mail gateway, or from another Sprint phone. I don't think any of those options will allow you to specify a port.

IF you had direct access to Sprint's message server, you could probably use some features of that interface to specify a port number with a text message. This capability will be limited to Sprint's partners and probably not available to the general public.

That's my best guess, but maybe somebody else knows better.

Launch a MIDlet

I think you are right. Sprint has only given support on the client applications to listen on specific ports (WMA support) but there is no support on their network to send an sms to that port. GSM carriers provide this support so far.

Now is there a way to launch/invoke a midlet from a remote server. Somebody asked me to look for UpNotify but I couldn't find a good documentation about that. I have the following questions.
1. Is it possible to launch/invoke a midlet from remote application (WAP push, sms push, UpNoitfy, anything) on sprint network?
2. If yes, how and if possible... is there a link/example for doing that?

Appreciate you help.
Amir

Re: Launch a MIDlet

[quote:67a4ecfe08="amirsagri"]Is it possible to launch/invoke a midlet from remote application (WAP push, sms push, UpNoitfy, anything) on sprint network?[/quote:67a4ecfe08]
Yes it's possible and no you can't do it. :(

Sprint has the ability to send push notifications to their handsets which could be used (in a round-about way) to launch a MIDlet. To do this, you must have direct access to Sprint's messaging gateway which, I'm guessing, you don't.

The best thing you can do is employ the technique described in the first post of this thread. You can send a link that the recipient must "click" on which will launch an application (by bouncing it off a server). There's no way to remotely force a phone to launch a MIDlet without the owner's consent.

Re: Launch a MIDlet From a Text Message

[quote:94e9144ca7]The browser will open but as soon as the page loads the phone gets redirected (automatically) to midlet:SendNote which launches my SendNote application (assuming it's installed on their phone).[/quote:94e9144ca7]

This works great for me on Sprint phones but not on others. Is this a Sprint-specific solution?

Launch a MIDlet From a Text Message

Yes, it's Sprint specific. Only Sprint phones support the "midlet:" schema.

Launch a MIDlet From a Text Message

Sorry for such a late reply on this one.
To the first note in this thread there is a much easier way to launch a midlet automatically. This works on my Sanyo MM-7400.

Send an sms like this.
midlet:midlet_name

When you view the sms, it will automcatically select the url, press go and it will lauch the midlet. No need of a website. Hope it helps.

Amir Sagri

Launch a MIDlet From a Text Message

[quote:733bf588f0="amirsagri"]This works on my Sanyo MM-7400.
Send an sms like this.
midlet:midlet_name

When you view the sms, it will automcatically select the url, press go and it will lauch the midlet. No need of a website. Hope it helps.[/quote:733bf588f0]

Wow, that's new. I wonder how many other phones that works on. I believe I've tried the same thing on a Sanyo 4900 and it wouldn't work. I know it doesn't work with a Sony Ericsson T608 or an LG PM-325.

Nice to hear it's being picked up by newer phones. I hope it's a trend but it's kind of hard for developers to count on it being there.