[英]GSON is deprecated. Which one we can use to serialize and deserialize Java objects to and from JSON?
Hi I want to store the Java Objects. 嗨,我想存储Java对象。
I have searched and found that the GSON library is doing the conversion of Java Object to Json String and vice versa. 我搜索发现GSON库正在将Java Object转换为Json String,反之亦然。 Then I can store the converted JSON String into the Shared Preferences.
然后,我可以将转换后的JSON字符串存储到共享首选项中。
But That GSON library is deprecated and there is no update after May 2013. 但是该GSON库已过时,并且在2013年5月之后没有更新。
Kindly provide me an alternate way to implement the same. 请为我提供另一种实现方法。
Thanks in advance. 提前致谢。
GSON is not deprecated and seems to be well supported ( commit history ). GSON没有被弃用,并且似乎得到了很好的支持( 提交历史记录 )。 If you are looking for an alternative Jackson is a popular one.
如果您正在寻找替代品, 杰克逊是一个受欢迎的人。
我认为这样做的原因是Google建议切换到Android Studio,如果您这样做,则无需下载jar, 只需在依赖项中简单地编译“ com.google.code.gson:gson:2.3.1”即可 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.