Search code examples
android-json

Make Json from model with gson in android studio


I have repeatedly searched for this on Google or other sources, but haven't found anything suitable for my problem, try to help me to resolve this


Solution

  • 'Normal' java objects inside of your Model String, int, Date, etc are already handled by gson, but to deserialize custom objects inside of a model you'll need to register your own custom serialization. Check out this: https://futurestud.io/tutorials/gson-advanced-custom-deserialization-basics