• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Availability of I/O connection interfaces for real implementation?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
Man Ip
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your answer, Eric.
-- Man
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Eric Giguere
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic