Some URIs return a JSONObject object while others return a JSONArray. I usually put everything into JSONArray and so far I had no exceptions. Of course, this is not the safest way so:
How to know what JSON URI returns?
Can I “guess” this via the type of URI or there is a better way? When I say the type of URI, look at Twitter’s URI like http://search.twitter.com/search.json?q=android where I can “guess” it returns a JSONArray. But such “guessing” prevents me to put anything into a JSONObject.
This should be specified in the API documentation, if you don’t want to count on it, you can use try-catch to find the actual type.