View Full Version : JVM ?
colin.prinn
14-04-2008, 12:28 AM
Does anyone know of a JVM for windows mobile 5/6 which supports UDP datagram protocol ?
DaveShaw
14-04-2008, 01:45 PM
Seen as though there has been no responses so far.
You could try asking this guy: Menneisyys (http://forum.xda-developers.com/member.php?u=253842)
Not much he doesn't know about Java.
Thanks
Dave
Menneisyys
14-04-2008, 03:33 PM
Do you need J2SE? I think all major JVM's (CrEme, IBM J9, Jeode, MySaifu) support UDP.
colin.prinn
14-04-2008, 04:18 PM
No, i'm not after J2SE.
I've trialed the Intent Midlet Manager from Risidoro (this site), the Esmertec JVM and one or two other dodgy implementations I've found around the place ( including IBM MIDP 2.0 Java Emulator V2.3.CAB which does have UDP support but was from a rather obscure dl site).
I am simply looking for a midlet manager for windows mobile which has implemented the UDP protocol. I don't mind paying for it but it does have to be for end-users to download and install.
Any thoughts ?
colin.prinn
14-04-2008, 04:20 PM
I think one of the points I may be missing is that the configuration I am looking at is the cldc, not cdc.
Menneisyys
16-04-2008, 12:32 PM
Frankly, I don't know - I haven't tested this for myself. Do you have a sample UDP tester MIDlet that I could quickly deploy, or, should I write one? (I'm a seasoned Java / MIDlet programmer but have very little time so I'd prefer the former)
colin.prinn
16-04-2008, 01:09 PM
This should provide a rough guide to support
import java.io.IOException;
import java.io.InputStream;
import javax.microedition.io.Connector;
import javax.microedition.io.HttpConnection;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.TextBox;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeExcepti on;
public class TestUDP extends MIDlet {
private final StringBuffer strContent = new StringBuffer();
TextBox textScreen = new TextBox("Location methods TEst", strContent.toString(), 1000, TextField.ANY);
protected void destroyApp(final boolean arg0) throws MIDletStateChangeException {
}
protected void pauseApp() {
}
boolean active = true;
private CommandListener commandListener = new CommandListener() {
public void commandAction(Command cmd, Displayable disp) {
if (cmd.getCommandType() == Command.ITEM) {
active = false;
String str = "";
textScreen.setString(str);
strContent.delete(0, strContent.length());
} else if (cmd.getCommandType() == Command.EXIT) {
active = false;
notifyDestroyed();
} else {
active = true;
new Thread() {
public void run() {
try {
Class.forName("javax.microedition.io.DatagramConnection");
log("Supported");
} catch (ClassNotFoundException e) {
log(e.getMessage());
}
test("datagram://test.com:22");
test("datagram://test.com:22;23");
test("udp://test.com:22");
test("udp://test.com:22;23");
}
private void test(String string) {
try {
Connector.open(string,Connector.READ_WRITE);
log("Success: " + string);
} catch (Throwable e) {
log("Failed: " + string);
}
}
}.start();
}
}
};
protected void startApp() throws MIDletStateChangeException {
Display.getDisplay(this).setCurrent(textScreen);
textScreen.addCommand(new Command("Exit", Command.EXIT, 1));
textScreen.addCommand(new Command("Start", Command.OK, 0));
textScreen.setCommandListener(commandListener);
}
private void log(final String message) {
if (strContent.length() > 200) {
strContent.delete(0, message.length());
}
strContent.append(" \n " + message);
textScreen.setString(strContent.toString());
}
}
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.