Re: [android-developers] JSONObject text must begin with '{' at character 1

2009-11-15 Thread Mark Murphy
TJ wrote:
> I'm having a weird error, seems to be cause whenever I hit JSONObject
> json=new JSONObject(result);.
> The error msg is org.json.JSONException: A JSONObject text must begin
> with '{. I have no idea how to fix this is any one have any idea
> PLEASE LET ME KNOW. The JSON File is
> 
> thanks
> 
> The JSON File is
> {"ResultSet":{
>   "totalResultsAvailable":"3",
>   "totalResultsReturned":"2",
>   "firstResultPosition":"1",
>   "Result":[
> {
>   "Title":"madonna 116",
>   "Summary":"Picture 116 of 184",
>   "Url":"http:\/\/www.celebritypicturesarchive.com\/pictures\/m\/
> madonna\/madonna-116.jpg",
>}
> },
> {
>   "Title":"madonna 118",
>   "Summary":"Picture 118 of 184",
>   "Url":"http:\/\/www.celebritypicturesarchive.com\/pictures\/m\/
> madonna\/madonna-118.jpg",
>   }
> }
>   ]
> }
> }

I don't know about the text of the error, but that does not look like
valid JSON. You have a couple of extra closing braces, AFAICT.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, $35/Year

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] JSONObject text must begin with '{' at character 1

2009-11-14 Thread TJ
I'm having a weird error, seems to be cause whenever I hit JSONObject
json=new JSONObject(result);.
The error msg is org.json.JSONException: A JSONObject text must begin
with '{. I have no idea how to fix this is any one have any idea
PLEASE LET ME KNOW. The JSON File is

thanks

The JSON File is
{"ResultSet":{
  "totalResultsAvailable":"3",
  "totalResultsReturned":"2",
  "firstResultPosition":"1",
  "Result":[
{
  "Title":"madonna 116",
  "Summary":"Picture 116 of 184",
  "Url":"http:\/\/www.celebritypicturesarchive.com\/pictures\/m\/
madonna\/madonna-116.jpg",
   }
},
{
  "Title":"madonna 118",
  "Summary":"Picture 118 of 184",
  "Url":"http:\/\/www.celebritypicturesarchive.com\/pictures\/m\/
madonna\/madonna-118.jpg",
  }
}
  ]
}
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en