When I read the MIDP documentation provided by Sun J2ME Wireless Toolkit, I found various connection interfaces in javax.microedition.io package including ContentConnection, DatagramConnection, HttpConnection, InputConnection, OutputConnection and StreamConnection. Motorola J2ME SDK, however, only includes HttpConnection. I therefore think it may not be able to implement, if I use other types of connection in coding. Are those connections mentioned above platform-dependent? If it is the case, I doubt the availability of socket programming in J2ME, as mentioned in the related question by Rex Lee at Jan 12. Any comments and/or ideas? Thanks. --Man
Those interfaces are defined by the CLDC. Profiles that provide any kind of network connectivity must use (or extend) one of those interfaces. MIDP only requires HTTP connectivity, so it's perfectly legal for an implementation to not support any other kind of connections, and hence never return any of the other interfaces. Eric
[This message has been edited by Eric Giguere (edited January 17, 2001).]
Hello, In the CLDC specification 1.0, it has been defined the DatagramConnection interface with several methods, such us: getAddress, send, receive, newDatagram, etc. In the MIDP specification it is supported HTTP protocol for networking. But you can also use DatagramConnection for building a client/server application, can�t you? In the Motorola J2ME SDK, there is an example called "UDP Tutorial", in which you can see the use of the UDP protocol for networking. And in the iDEN developer network site, you can see the sample code "MotoShop", which is a complete client/server application based in the DatagramConnection. I am a little confused with these issues, because I can see in some documents about J2ME networking, that HTTP is the only supported protocol to build client/server applications. You have two possibilities to build a client/server applications, one based on HTTP (HTTPConnection-MIDP), and other based on datagrams (DatagramConnection-CLDC), haven�t you? Or am I wrong? Thank you! Best Regards, Luis �ngel.
Joined: Oct 25, 2000
The MIDP spec says that HTTP is the only protocol that the device MUST support. Vendors are free to provide support for other protocols in addition to this, except of course that the Connection objects they return must extend one of the Connection interfaces defined in the CLDC. So Motorola can support UDP. This doesn't mean that every MIDP-enabled device will support UDP, though. HTTP is the only guarantee if you want portability between MIDP devices. Eric
subject: Availability of I/O connection interfaces for real implementation?