mobile-roadmap / android-developer-roadmap

Android Developer Roadmap 2020
Creative Commons Attribution Share Alike 4.0 International
4.14k stars 512 forks source link

Can we suggest Moshi for JSON Serialization / Deserialization ? #8

Closed afrinsulthana closed 5 years ago

afrinsulthana commented 5 years ago

I would like to know if Moshi can be a better recommendation than GSON if I am planning to start a new Android project?

I read the following few advantages of Moshi in comparison with GSON:

  1. Better JSON Serialization and Deserialization performance
  2. Lesser size in APK.
  3. Better Kotlin support. More robust in capturing errors and exceptions like missing params in response, in Gson missing params becomes NULL instead of throwing Exception whereas Moshi can parse JSON based on Kotlin declaration to determine whether a field can be nullable or not.

I would like to hear your suggestions since I have not used Moshi before.

krizzu commented 5 years ago

I believe that Network Handling could point to JSON data parsing which points to Gson Moshi and other valid libs.

drcabral commented 5 years ago

Hello @afrinsulthana and @Krizzu!

Thanks for all of the suggestions!

We are including them on our roadmap in our next update the Moshi and the section JSON data parsing (it will be in #6).

drcabral commented 5 years ago

added in #6