I am working on an Android application. In my application, I need to convert a string to a Json Object, and then parse the values. I checked the solution in stackoverflow and found a similar problem here link
Solution looks like this
`{"phonetype":"N95","cat":"WP"}` JSONObject jsonObj = new JSONObject("{\"phonetype\":\"N95\",\"cat\":\"WP\"}");
I use the same in my code. My line
{"ApiInfo":{"description":"userDetails","status":"success"},"userDetails":{"Name":"somename","userName":"value"},"pendingPushDetails":[]} string mystring= mystring.replace("\"", "\\\"");
And after the replacement, I got a result like this
{\"ApiInfo\":{\"description\":\"userDetails\",\"status\":\"success\"},\"userDetails\":{\"Name\":\"Sarath Babu\",\"userName\":\"sarath.babu.sarath babu\",\"Token\":\"ZIhvXsZlKCNL6Xj9OPIOOz3FlGta9g\",\"userId\":\"118\"},\"pendingPushDetails\":[]}
when I execute JSONObject jsonObj = new JSONObject(mybizData);
I get json exception below
org.json.JSONException: Expected literal value at character 1 of
Please help me solve my problem.
json android jsonexception string-conversion
sarath Aug 12 '13 at 17:17 2013-08-12 17:17
source share