1try {
2 JSONObject jsonObject = new JSONObject("{\"phonetype\":\"N95\",\"cat\":\"WP\"}");
3}catch (JSONException err){
4 Log.d("Error", err.toString());
5}
6
1I add GSON dependency in my POM --> It’s a json parser. That is
2used to convert from java object to json and from json to java
3object
4SERIALIZATION: CONVERT JAVA OBJECT -> JSON
5DE-SERIALIZATION: CONVERT JSON -> JAVA OBJECT