Error

Notice: Undefined property: stdClass::$forum_tid in forum_node_view() (line 275 of /home/wfrantz/www/sprintdevelopers/modules/forum/forum.module).

Launch a MIDlet From a Text Message

Submitted by wfrantz on Sat, 01/29/2005 - 09:47

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:

<head>
<meta http-equiv='refresh' content='1;URL=midlet:<?php echo $_SERVER['QUERY_STRING'] ?>' />
</head>

Lets call it "midlet.php". Now I can send text messages with links like this:

http://apgap.com/midlet.php?SendNote

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.