Skip to content

Serialization library recommendation #25

Closed

Description

@SubhrajyotiSen

The README specifies that the project uses Gson as the serialization library.

According the Gson README:

Gson is not a recommended library for interacting with JSON on Android. The open-ended reflection in the Gson runtime doesn't play nicely with shrinking/optimization/obfuscation passes that Android release apps should perform.
If your app or library may be running on Android, consider using Kotlin Serialization or Moshi's Codegen, which use code generation instead of reflection. This avoids Gson's runtime crashes when optimizations are applied (usually due to the fields missing or being obfuscated), and results in faster performance on Android devices. The Moshi APIs may be more familiar to users who already know Gson. If you still want to use Gson and attempt to avoid these crashes, you can see how to do so here.

Given that both the projects are from Google and this repository will act as a guiding example for developers, the conflicting recommendation can be confusing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions