views:

1926

answers:

3

I want to call some RESTful web services from a J2ME client running on a MIDP enabled mobile device. I read the MIDP api for HTTPConnections and thought this is just crying out for a simple wrapper to hide all those unpleasant byte arrays and such like. Before I write my own I wondered whether there was a good open source library already available.

-FE-

A: 

I don't know of any such library, but found some succinct examples of accessing various RESTful web services

rupello
+2  A: 

You might want to check out this little gem, Mobile Ajax for Java ME:

https://meapplicationdevelopers.dev.java.net/mobileajax.html

One part is (from the site):

Asynchronous I/O for Java ME

This library provides the equivalent of XmlHttpRequest for Java ME with some additional functionality useful for invoking RESTful web services.

It is layered on top of the com.sun.me.web.path library. Features include -

* Asynchronous versions of HTTP Get and Post
* HTTP Basic Authentication
* Multipart MIME (sender only)
* Progress listeners
darius
The link needs fixing as it has an extra http at the beginning
rupello
It is now fixed.
darius
A: 

We ended up writing our own simple wrapper api for a variety of reasons not the least of which was the fact that the Sony Ericsson K750 that we were developing for had a weird bug (that SE refused to fix) where if you tried to get/use a connection when the device was off network, more than about 20 times, the internal connection pool would get hosed and never recover unless you restarted the app.