Skip to content

Serialization library recommendation #25

@SubhrajyotiSen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions