Sagar Zala Sagar Zala - 6 days ago 6
Android Question

How to convert buffered-reader string to JSON in android?

I get json response in Buffered Reader. Now How to convert buffered-reader string to JSON?

I get the String like

[
{
"email": "test@gmail.com",
"password": "test@123!",
"role": "monitor",
"code": "0"
}
]

Answer
JSONArray aardata = new JSONArray(your buffered reader String):

And For Parse

  JSONObject obj = arrdata.getJsonObject(0);

      String email = obj.getString('email');
Comments