How to parse the Json response in android?

后端 未结 6 1766
一生所求
一生所求 2020-12-14 23:19

i m getting this response in a result of GET request to server

{\"LL\": { \"control\": \"dev/sys/getkey\", \"value\": \"4545453030304138303046392035343733373         


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-14 23:37

    you can parse current json String to get value from it as :

    // Convert String to json object
    JSONObject json = new JSONObject(responseText);
    
    // get LL json object
    JSONObject json_LL = json.getJSONObject("LL");
    
    // get value from LL Json Object
    String str_value=json_LL.getString("value"); //<< get value here
    

提交回复
热议问题