Hello all!
I want to make my midlet start automatically when there is datagram connection to specific port.
At first I tried to use static Push Registration for my midlet. This is its jad file:
MIDlet-1: MobiVideo, , com.sitex.mobi.plugins.MobiVideo
MIDlet-Jar-Size: 101107
MIDlet-Jar-URL: MobiVideo.jar
MIDlet-Name: MobiVideo
MIDlet-Push-1: datagram://:5000,com.sitex.mobi.plugins.MobiVideo,*
MIDlet-Vendor: Sitex
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.0
When I install the midelt on my phone (Sony Ericsson z750) it downloads in full and then throws "Operation failed" message.
After that I removed MIDlet-Push-1 line from jad file and tried to use dynamic Push Registration. My code is below:
String midletClassName = MobiVideo.class.getName();
String filter = "*";
String URL = "datagram://:5000";
try {
PushRegistry.registerConnection(URL, midletClassName, filter);
} catch (Exception e) {
showAlert(e.getMessage(), true);
}
I don't have any error message in this case. BUT when I try to retrieve information about all registered connections with PushRegistry.listConnections(false) it returns nothing.
Does anybody have any idea what is wrong?
Thanks.

Reply With Quote



