Creating models

To create the models, we need to keep the same model items as the backend. But we will also include the Gson annotation, @SerializedName. The value of the @SerializedName annotation is used when serializing and deserializing objects. Here, @SerializedName("username") is stating that this is the name of the Username in the JSON. Though we implement the Gson, you can call these model classes as the response of the API. That means when this application requests the server and fetches the content, then this content will be returned with the help of these model classes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.12.232