Exploring Moshi with JSON: A Better JSON Parsing For Android!

Why a library?

Exploring Moshi with JSON

{

“id” : “m1”,

“movie_name” : “Iron Man”,

“rating” : 7.9

}

class MovieItem{

String id;

String name;

float rating;}

Data class for JSON object

class MovieItem{

@Json(name=”id”) String id;

@Json(name=”movie_name”) String name;

@Json(name=”rating”) float rating;

}

Annotated data class for Moshi

class MovieItem{

String id;
@Json(name=”movie_name”) String name;
float rating;

}

Minimized data class

Direct benefits

Other benefits

Are you in a search of a mobile app development company?

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store