How can I parse a JSON object from a weblink into Android and store the different values into ArrayLists?
The JSON object of users looks like the below. It comes fro
Use GSON library to parse JSON
to java class. It is very simple to use.
Gson gson = new Gson();
Response response = gson.fromJson(jsonLine, Users.class);
Generated model example:
public class Users {
@SerializedName("Users")
@Expose
public List Users = new ArrayList();
}
public class User {
@SerializedName("name")
@Expose
public String name;
@SerializedName("lon")
@Expose
public double lon;
@SerializedName("lat")
@Expose
public double lat;
}