[{"customer_id":"12345","username":"admin","role":"1","userid":"001","status":SUCCESS"}]
How to get Json
Array
value in J2ME
[{"customer_id":"12345","username":"admin","role":"1","userid":"001","status":SUCCESS"}]
How to get Json
Array
value in J2ME
1st of all minor mistake in the string posted..it shd be
[{\"customer_id\":\"12345\",\"username\":\"admin\",\"role\":\"1\",\"userid\":\"001\",\"status\":\"SUCCESS\"}]
You can download the following files for json Parsing..Use them in your project
http://grt192.googlecode.com/svn/trunk/CannonBot/src/org/json/me/
Try the following code
try {
JSONArray tmparr = new JSONArray(response);
JSONObject tmpobj = new JSONObject(tmparr.getString(0));
System.out.println("custid " + tmpobj.get("customer_id"));
} catch (JSONException e) {
e.printStackTrace();
}