开发者

XML binding tools for Android [closed]

As it currently stands, this question is not a good fit for ou开发者_开发技巧r Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

I would like to compare some XML binding tools for Android, however there does not seem to be many available. Any that are, are cumbersome or very limited in capability. What frameworks other than the Simple XML framework are available for the Android platform.

Here I am interested in frameworks that do all the heavy work, so KXML, DOM, and SAX are not really what I am looking for. Frameworks like JiBX and JAXB are more along the lines of what I am looking for.


What you really want is the Simple XML Library which will work on Android.

I actually wrote a blog post explaining exactly how to use it: you can find that here

Edit: Lol, I just looked at who the author of this question was and I am pretty sure that ng is Niall himself, the person that wrote the Simple XML Library.


I have used http://x-stream.github.io/. Very simple to use and fast.


The Jackson JSON project works on the Android platform. XML support is just in an experimental stage, but it should be part of your comparison, as it is the performance champion. No schema support. http://jackson-users.ning.com/profiles/blogs/experimental-support-for


Basically you can use every XML databinding as long it is pure java. XStream and Jackson are good choices ( xstream is really easy to use, and jackson offers high performance )

You just have to watch for pull-parsing model to prevent extensive memory consumption.

Main drawback from those libraries is size. If you like to have really lightweight solution, you may opt for JSON format and use GSON pull parser. I developed simple databinding around pull parsing capabilities:

https://github.com/ko5tik/jsonserializer

Feel free to use and comment


JiBX works great on android. JiBX already uses XMLPull, which is the default XML parser for android.

Just create your JiBX binding, include jibx-run.jar in your app and you are good to go.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜