0
{"66":{"waktu":"2013-10-01 12:45:11","hp":"+6285716157476","sms":"BKPM:\ntest ke budi","flash":"0","sts":"1"}}
Ivaylo Strandjev
  • 66,530
  • 15
  • 117
  • 170

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
  • 8,472
  • 5
  • 40
  • 48
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
  • 78,004
  • 28
  • 199
  • 222