I am new to JSON
and I am getting the follwoing Exception:
org.json.JSONArray cannot be converted to JSONObject
in the first line of try se
This
JSONObject json = new JSONObject(strResponse);
// your strResponse is a json array
should be
JSONArray jsonarray = new JSONArray(strResponse);
[
represents json array node
{
represents json object node
for(int i=0; i < jsonarray.length(); i++) {
JSONObject jsonobject = jsonarray.getJSONObject(i);
String id = jsonobject.getString("id");
String title = jsonobject.getString("title");
String company = jsonobject.getString("company");
String category = jsonobject.getString("category");
}