{"66":{"waktu":"2013-10-01 12:45:11","hp":"+6285716157476","sms":"BKPM:\ntest ke budi","flash":"0","sts":"1"}}
            Asked
            
        
        
            Active
            
        
            Viewed 314 times
        
    0
            
            
         
    
    
        Ivaylo Strandjev
        
- 69,226
- 18
- 123
- 176
2 Answers
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
- 
                    why down-vote, please read answer first – Maxim Shoustin Oct 01 '13 at 07:38
