views:

150

answers:

4

I have a J2ME application that needs to communicate with my server, and download information for the application in XML. My application could run a lot faster if I had a better format of data, which would allow me to have more efficient parsing code.

Does anyone know an efficient substitute for XML? Maybe something specific for mobile phones?

A: 

There's always JSON, but I don't know if it is what you need.

http://java.sun.com/developer/technicalArticles/javame/json-me/

Joeri Sebrechts
A: 

I haven't heard about many protocols for this kind of stuff (efficient and small) but you could try Hessian which is a lot better than xml in terms of efficiency.

http://www.caucho.com/resin-3.0/protocols/hessian.xtp

but be weary and check out the following which might help

http://stackoverflow.com/search?q=j2me+hessian

Specifically

http://stackoverflow.com/questions/82691/what-are-the-best-remoting-technologies-for-mobile-applications

PintSizedCat
+1  A: 

http://stackoverflow.com/questions/8599/best-binary-xml-format-for-javame

The conclusion being WBXML which I would agree with.

roryf
+1  A: 

You could try Google's Protocol Buffers. Very compact binary encoding and highly optimised parser/encoder. In short, you write some descriptions about your structures, and it compiles to a specialized OOP library in Java, C++ or Python that you include in your client and server.

Javier
hsmit
no idea; but you can try.... after all, the PB compiler generates a library; i'd be surprised if it had any 'big Java' requirements.
Javier