I am new to Android development and JAVA. I need to pass JSONObject values into android class. I am aware of the external libraries like GSON and others (like Jackson), but for this task I mus use only JSON. So far I have created an JSONObject:
public void jsonObject(){
JSONObject test1 = new JSONObject();
try{
test1.put("name", "Pete");
test1.put("surname", "Thompson");
test1.put("age", "24");
test1.put("height","182");
test1.put("id", "45");
}
catch (JSONException a){
a.printStackTrace();
}
}
From this object, I need to pass the data to the following class members:
private String name;
private String surname;
private int age;
private int height;
private long id;
Thanks in advance.