开发者

Is google gson running on android?

开发者 https://www.devze.com 2022-12-21 19:01 出处:网络
I\'m playing arround with google gson for communication with my web back end at the moment. This and this older posts indicate that there are some problems with gson on android.

I'm playing arround with google gson for communication with my web back end at the moment. This and this older posts indicate that there are some problems with gson on android.

I did some easy tests on the device already but maybe I just missed the bug.

Edit I'm now parsing a lot more data. Generic lists etc. still not encountered the bug.

Has anybody used gson o开发者_StackOverflown Android already? How does it work? Has somebody encountered bugs or something that will stop me from using it once it gets more complicated?


I've succesfully used it (gson 1.4) with both Android 1.5 and 1.6. No problems at all. The only point is gson still not being able to handle circular references in the objects you try to serialize.


I've had problems with it when running in the emulator (Android 1.1) which was fine when testing on my phone (Android 1.5)

I got the following exception when serializing a complex object:

An exception occurred: java.lang.TypeNotPresentException    

Looks like as long as you target a later version of Android (1.5 in my case) you're good to go...

0

精彩评论

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

关注公众号