views:

25

answers:

2

I would like to serialize an object to XML inside Android.

Any libs suggested?

PS: Already tried XStream, but it doesn't serialize enums correctly with Android. The issue is here: http://stackoverflow.com/questions/3533894/serialization-problem-with-enums-at-android

A: 

have you tried JSON?

http://www.ibm.com/developerworks/web/library/x-andbene1/index.html?ca=dgr-lnxw82JSON4Adroid

mohammad shamsi
Actually, I didn't. Thanks for the link, I prefer to use JSON myself instead of XML, in the majority of cases. Anyway, the question remains: isn't there a nice lib to serialize Android Java objects to XML, one that avoids this xStream pitfall?
Rodrigo Gama
A: 

Unfortunately I don't think there is a good solution for xml serialization of objects in Android yet. Most of the existing solutions are too heavyweight for use in mobile apps, and depend on things Android doesn't support.

For an overview of XML options, see working with xml in Android.

Mayra