java - how to parse this response using JSONObject -
I have the response that I can get the form server back. I want to parse it and want to get out of hospital_name. How do I go about this? [{"Hospital": {"id": "63,083" "hospital_name": "Institute of Colorado Mental Health", "hospital_add_1": "1600 W" "Hospital_pip": "Hospital_phone": "719-546-4000 \ r", "Hospital_Apps": "Hospital _ ADDU": Faucet, "Hospital", "Pueblo", "Hospital_State": "CO", "Hospital_Jip": "81003" "" "," Hospital ":" "," hospital ":" "," hospital_ description ": blank," callcenter_agent_proplowl ":" 0 "," hospital_site ":" "," MDPKette Suite ":" 0 "," Facebook " Department ": []," Image ": []," Notes ": []}, {" As "Pumpblow", "Hospital", "Hospital", "Hospital", "Hospital", "Hospital", "Hospital", "Hospital", "Hospital", "Hospital", "Hospital", "Hospital", "Hospitalview", "Hospital_add_1": "400 W 16th St", "hospital_add_2" "Hospital_zip": "hospital_zip": "hospital_zip": "81003", "hospital_phone": "719-584-4000 \ r", "hospital_fax": blank, "hospital_details": blank, "callcenter_agent_propivil": " "," Hospital_ite ":" mdpocket_approval ":" 0 "," Facebook ":" "}," floor ": []," department ": []," image ": []," notes ": [] }, {"Hospital": {"id": "63,085" "hospital_name": "St. Mary-Carwin Medical Center", "hospital_add_1": "1008 Minnequa "Hospital_fip": "hospital_zip": "81004", "hospital_phone": "719-560-4000 \ r", "hospital_fax": "hospital_face", "hospital_fet" "", "Hospital_ description": blank, "callcenter_agent_uproval": "0", "hospital_site": "", "mdpocket_approval": "0", "facebook": ""}, "bottom": [], "department ": []," Image ": []," Notes ": []}]
Edit JSON * Updated JSON *
[// json array node {// json object node "hospital": {// json object hospital
for parsing A
JSONArray JR = New JSONArray ("jsonstring"); For (int i = 0; i & lt; jr.length (); i ++) {JSONObject jb = (JSONObject) jr.getJSONObject (i); JSONObject jb1 = (JSONObject) jb.getJSONObject ("hospital"); String name = jb1.getString ("hospital_name"); Log.i ("name ....", name); }
log
02-18 03: 09: 43.950: i / nm .... (9 51): Colorado mental health institute 02- 18 03: 09: 43.950: I / Name .... (951): Parquva Medical Center 02-18 03: 09: 43.950: I / Name .... (9 51): St. Mary-Corwin Medical Center
Comments
Post a Comment