Using XMLBeans on Android
Asked Answered
I

3

5

I was just wondering if anyone had any success in getting XMLBeans (or any other generator) to work on android. It would be very nice if I could use it because I have a very large schema that I would rather not write all the classes by hand.

I had asked about this on the android developers mailing list, but no one responded. This tells me that either they don't care, or no one feels like telling me its not possible.

If anyone knows of anything else like XMLBeans that works for android, please let me know. It would be very helpful.

Thanks, Robbie

Inceptive answered 14/7, 2009 at 15:35 Comment(0)
P
5

If you're looking to do class generation and DOM parsing, XMLBeans is probably pretty heavy-weight for a mobile device running android. All of the code generated by XMLBeans makes synchronized calls into an underlying data store that I've seen as a hot spot several times when profiling.

I can't suggest any alternatives, but I would be wary of using this even if you could get it to work, because of the afore mentioned performance issue.

Paella answered 14/7, 2009 at 15:57 Comment(1)
Thanks. I didn't know that XMLBeans was so bloated. Normally I use it in a server environment where performance isn't that big of an issue, so I never thought about it.Inceptive
G
1

You can use Castor . Just be sure, in Android 2.1, not to use default android SAXParser. You'll get namespace errors. You do this by defining the parser to be, for example, Xerces (and the you add the required JARS), in core.properties . In android 2.2 it may be ok. Note that if you create an xmlcontext for the unmarsheler with xerces, it still won't work, as the mapping itself would be parsed with android's SAX. It must be done at core (top level properties file) so that even the mapping is parsed by xerces. finally - performance is as slow as you can expect... :( Good luck SM

Gera answered 22/1, 2011 at 13:23 Comment(0)
M
1

I got JAXB working on Android.

Mireille answered 19/8, 2012 at 22:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.