I have `JSONArray` having following structure:

```
{

    "People":[
        {
            "006MST21IND":{
                "desc":"MST21 BAL. PR. THERMOSTATIC STEAM TRAP",
                "attribute":"1,b_“F”ELEMENT / c_`G' ELEMENT;2,b_“F”ELEMENT / c_`G' ELEMENT;3, b_“F”ELEMENT / c_`G' ELEMENT"
            }
        },
        {
            "006MST22IND":{
                "desc":"MST21 BAL. PR. THERMOSTATIC STEAM TRAP",
                "attribute":"1,b_“F”ELEMENT / c_`G' ELEMENT;2,b_“F”ELEMENT / c_`G' ELEMENT;3, b_“F”ELEMENT / c_`G' ELEMENT"
            }
        }
    ]

}

```

I am trying, but it is giving following exception,

```
org.json.JSONException: Value [{"006MST21IND":{"attribute":"1,b_�F�ELEMENT \/ c_`G' ELEMENT;2,b_�F�ELEMENT \/ c_`G' ELEMENT;3, b_�F�ELEMENT \/ c_`G' ELEMENT","desc":"MST21 BAL. PR. THERMOSTATIC STEAM TRAP"}},{"006MST22IND":{"attribute":"1,b_�F�ELEMENT \/ c_`G' ELEMENT;2,b_�F�ELEMENT \/ c_`G' ELEMENT;3, b_�F�ELEMENT \/ c_`G' ELEMENT","desc":"MST21 BAL. PR. THERMOSTATIC STEAM TRAP"}}] 
at People of type org.json.JSONArray cannot be converted to JSONObject

```

code is :

I am saving json data in file and taking from it as,

```
File root = Environment.getExternalStorageDirectory();
File jsonFile = new File(root, "jsonFile.txt");
FileInputStream stream;
String jsonStr = null;
stream = new FileInputStream(jsonFile);

FileChannel fc = stream.getChannel();
MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());

jsonStr = Charset.defaultCharset().decode(bb).toString();

stream.close();

```

then by using that jsonStr, i am using following logic...

```
JSONObject jsonObj = new JSONObject(jsonStr);

JSONObject jsonObj1 = jsonObj.getJSONObject("People");
JSONArray myJson=jsonObj1.getJSONArray("006MST21IND");

if (myJson!=null && myJson.length()!=0) {

    for(int i=0;i<myJson.length();i++)
    {
        JSONObject obj2 = myJson.getJSONObject(i);

        desc = obj2.getString("desc");
        attribute = obj2.getString("attribute");

        Log.e("Desc:", desc);
        Log.e("Attribute:", attribute);
    }

}

```

I was trying but failed.