0
{"66":{"waktu":"2013-10-01 12:45:11","hp":"+6285716157476","sms":"BKPM:\ntest ke budi","flash":"0","sts":"1"}}
Ivaylo Strandjev
  • 69,226
  • 18
  • 123
  • 176

2 Answers2

2

It is appearing the JSON structure... use the JSON parser to parse it

Refer the link how-to-parse-json-in-java

Community
  • 1
  • 1
Rakesh Soni
  • 10,135
  • 5
  • 44
  • 51
2

The easiest way to use Json parser for your String.

 public static void main(String[] args) throws JSONException {
    String jsonString  = "{" + 
            "   \"66\": {" + 
            "       \"waktu\": \"2013-10-01 12:45:11\"," + 
            "       \"hp\": \"+6285716157476\"," + 
            "       \"sms\": \"BKPM:\\ntest ke budi\"," + 
            "       \"flash\": \"0\"," + 
            "       \"sts\": \"1\"" + 
            "   }" + 
            "}";


    JSONObject jsonObject = new JSONObject(jsonString);
    JSONObject a = (JSONObject) jsonObject.get("66");
    String sts = (String) a.get("sts");



    System.out.println("sts=" + sts);       
}   

Output:

sts=1
Maxim Shoustin
  • 77,483
  • 27
  • 203
  • 225