在数组中解析json数据数组

Nit*_*pta 1 parsing android json web-services

   {
   "TABLE":[
      {
         "ROW":[
            {
               "COL":[
                  {
                     "DATA":"< OutBoundSMS PhoneId='3' PhoneNo='1111111111' MessageText='OutBound SMS Application Test' />"
                  }
               ]
            }
         ]
      }
   ]
}
Run Code Online (Sandbox Code Playgroud)

如何像这种格式解析json数组?
解析时我收到此错误:"无法转换为json对象".

ρяσ*_*я K 5

将当前Json字符串解析为:

JSONObject json=new JSONObject("Your Json String");
JSONArray jsonarray = json.getJSONArray("TABLE");

for(int i=0;i<jsonarray.length();i++){

  JSONObject jsonnew=jsonarray.getJSONObject(i);
  JSONArray jsonarrayROW = jsonnew.getJSONArray("ROW");

   for(int j=0;j<jsonarrayROW.length();j++){
     JSONObject jsonnewtwo=jsonarrayROW.getJSONObject(j);
     JSONArray jsonarrayCOL = jsonnewtwo.getJSONArray("COL");

      for(int k=0;k<jsonarrayCOL.length();k++){

        JSONObject jsonnewthree=jsonarrayCOL.getJSONObject(k);

        //get DATA here

           String str_data=jsonnewthree.getString("DATA");
       }
   }
}
Run Code Online (Sandbox Code Playgroud)