Based on my observation, the PushRegistry feature in Nokia N95 acts unpredictably when the device misses one or more SMS meant for a listening port, i.e. most probably because the device was switched off.
Perhaps a little story would be in order :)
OK, say on your Nokia N95 device, there is a MIDlet which listens for incoming SMS at port 8044.
Now lets send a series of SMS targeted at port 8044 above.
SMS A was sent to the device when it was switched on. MIDlet wakes up ok.
Let's switched off the device.
Send SMS B to said device
Send another SMS, C.
And another one, D.
Now switch on the device.
Your MIDlet may or may not be awaken at this point (even if it does wake up, the content you get may come from either SMS B, C or D !).
A new SMS, E, is sent to the device.
Now you'll discover that the MIDlet will wake up but the contents you see may come from SMS B, C, or D.
Let's say when E was sent, your MIDlet displays content from B instead, not the one in E.
Now another new SMS, F, gets pushed to the device. You'll discover that the contents of SMS C will be displayed instead of the one in F ! (Interestingly if SMS E, resulted in D being displayed, then SMS F will display the contents in SMS E.)
As you can see, the order is intact i.e. SMS B followed by C etc. However, you're not getting the actual SMS which wakes up the MIDlet.
Weird. Very very weird.
Is it a firmware bug ? Could it be the carrier ? Honestly I can't be sure :/
Solution ? Uninstall & reinstall the MIDlet (and ... no, rebooting the device doesn't work either)
Of course once your MIDlet misses an SMS targeted for its PushRegistry port, then the issue pops up again. Hence, there is no solution really :(
Showing posts with label Nokia. Show all posts
Showing posts with label Nokia. Show all posts
Monday, January 28, 2008
"Must be Server" error from PushRegistry with sms
Whew ! Took 2 days to figure this out.
Recently attempted to create a MIDlet which wakes up on SMS using the PushRegistry feature in Java ME.
Kept getting "Must be Server" error at the
Turns out the JAD file of said MIDlet has the following incorrectly typed PushRegistry entry :
There should be a ":" after the 2 "slashes" like so :
After the above fix, the "Must be Server" disappeared :)
Recently attempted to create a MIDlet which wakes up on SMS using the PushRegistry feature in Java ME.
Kept getting "Must be Server" error at the
mc.receive()line in following code snippet :
if (url.startsWith("sms://")) {
MessageConnection mc = (MessageConnection) Connector.open(url);
Message msg = mc.receive();
String data = "";
if (msg != null) {
if (msg instanceof TextMessage) {
form.append("TextMessage\n");
data = ((TextMessage)msg).getPayloadText();
}
}
}
Turns out the JAD file of said MIDlet has the following incorrectly typed PushRegistry entry :
MIDlet-Push-1: sms://8033, org.whatever.Poink, *
There should be a ":" after the 2 "slashes" like so :
MIDlet-Push-1: sms://:8033, org.whatever.Poink, *
After the above fix, the "Must be Server" disappeared :)
Labels:
Java ME,
MessageConnection,
MIDlet,
Must be Server,
Nokia,
PushRegistry,
SMS,
wake up
Subscribe to:
Posts (Atom)