communication with server in J2ME ?
Hello,
Is there way to communicate in J2ME like RMI in J2SE ?
If not what would be best way to do similar kind of job ?
I have an desktop application that uses RMI with an applet. I want to port that application( write a new one which does similar functionality) for micro devices like cell phone and PDA.
Any ideas would be realy helpfull.
thanks in advance,
chini
[chinimilli],
The current J2ME specification for CLDC 1.0 specifies a generic connection framework that supports the following interface types:
o Basic serial I/O
o Datagram-oriented communication
o Circuit-oriented communication e.g. TCP
o HTTP connections
The CLDC specification offers the connection framework but does not define any network protocols per say. It is up to the J2ME profiles to define the protocols for a specific device category. For MIDP 1.0, only HTTP connection is supported.
Connections are created using the static method in a system class called Connector. So for MIDP right now, the line of code to open a HTTP connection will be:
Connector.open("http://www.MyWebServer.com:8080/MyApp.txt");
So we would suggest that you write a new application that has the same functionality but only using HTTP connections for the device to communicate with the web server rather than use RMI as CLDC/MIDP does not support RMI.
HTH.
Allen Lai
Developer Technical Support
SUN Microsystems
http://www.sun.com/developers/support/