Dear liking in greeting you, I am trying to consume an object Json
through Volley
using Android
, however I only get to consume a part of Json
. I am new to this, I hope you can help me, Thanks in advance.
You can access with:
JSONObject contactJObject = jsonObject.getJSONObject("contact");
System.out.println(contactObject.getString("mobile"));
The data that you were able to obtain is inside a json object but the data that you point out is also inside an object called "contact":
Get the object "contact" and then its properties:
JSONObject jsonObjectContact = jsonObject.getJSONObject("contact");
Toast.makeText(getApplicationContext(), "Respuesta"+
jsonObject.getString("id") + " " +
jsonObject.getString("name") + " " +
jsonObject.getString("email") + " " +
jsonObject.getString("gender") + " " +
jsonObjectContact.getString("mobile") + " " +
jsonObjectContact.getString("home") + " " +
jsonObjectContact.getString("office"), Toast.LENGTH_LONG).show();