That first logcat you posted was pretty interesting. It was telling
you that what you are getting back from you webservice is a JSONArray,
not a JSONObject, as you are assuming it is.

They aren't the same thing. You need to get clear on what you are
expecting with what they are sending or you are not going to have luck
here.


On Apr 30, 7:57 am, Rahul <[email protected]> wrote:
> Really thank you Jose for posting the code. I'll definitely try it out
> and let you know if there are any further issues.
>
> Regarding the logcat, Hey Brion,I have posted wrong log cat in the
> above posts. Sorry for that... Below you can see the exact log cat
> errors...
>
> 04-30 13:09:46.656: INFO/ActivityManager(584): Starting activity:
> Intent { act=android.intent.action.MAIN
> cat=[android.intent.category.LAUNCHER] flg=0x10000000
> cmp=com.WorldToyota/.Alerts }
> 04-30 13:09:50.417: ERROR/JSON(924): There was an error parsing the
> JSON
> 04-30 13:09:50.417: ERROR/JSON(924): org.json.JSONException:
> JSONArray[0] is not a JSONObject.
> 04-30 13:09:50.417: ERROR/JSON(924):     at
> org.json.JSONArray.getJSONObject(JSONArray.java:268)
> 04-30 13:09:50.417: ERROR/JSON(924):     at
> com.WorldToyota.AlertsAdd.retrieveJSONArray(AlertsAdd.java:30)
> 04-30 13:09:50.417: ERROR/JSON(924):     at
> com.WorldToyota.Alerts.onCreate(Alerts.java:20)
> 04-30 13:09:50.417: ERROR/JSON(924):     at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
> 1123)
> 04-30 13:09:50.417: ERROR/JSON(924):     at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2364)
> 04-30 13:09:50.417: ERROR/JSON(924):     at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 2417)
> 04-30 13:09:50.417: ERROR/JSON(924):     at
> android.app.ActivityThread.access$2100(ActivityThread.java:116)
> 04-30 13:09:50.417: ERROR/JSON(924):     at android.app.ActivityThread
> $H.handleMessage(ActivityThread.java:1794)
> 04-30 13:09:50.417: ERROR/JSON(924):     at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 04-30 13:09:50.417: ERROR/JSON(924):     at
> android.os.Looper.loop(Looper.java:123)
> 04-30 13:09:50.417: ERROR/JSON(924):     at
> android.app.ActivityThread.main(ActivityThread.java:4203)
> 04-30 13:09:50.417: ERROR/JSON(924):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 04-30 13:09:50.417: ERROR/JSON(924):     at
> java.lang.reflect.Method.invoke(Method.java:521)
> 04-30 13:09:50.417: ERROR/JSON(924):     at
> com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:791)
> 04-30 13:09:50.417: ERROR/JSON(924):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
> 04-30 13:09:50.417: ERROR/JSON(924):     at
> dalvik.system.NativeStart.main(Native Method)
> 04-30 13:09:50.688: ERROR/JSON(924): There was an error creating the
> JSONObject
> 04-30 13:09:50.688: ERROR/JSON(924): org.json.JSONException:
> JSONObject["suggestions"] not found.
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> org.json.JSONObject.get(JSONObject.java:287)
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> org.json.JSONObject.getJSONArray(JSONObject.java:362)
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> com.WorldToyota.AlertsAdd.retrieveJSONArray(AlertsAdd.java:41)
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> com.WorldToyota.Alerts.onCreate(Alerts.java:20)
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
> 1123)
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2364)
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 2417)
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> android.app.ActivityThread.access$2100(ActivityThread.java:116)
> 04-30 13:09:50.688: ERROR/JSON(924):     at android.app.ActivityThread
> $H.handleMessage(ActivityThread.java:1794)
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> android.os.Looper.loop(Looper.java:123)
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> android.app.ActivityThread.main(ActivityThread.java:4203)
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> java.lang.reflect.Method.invoke(Method.java:521)
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:791)
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
> 04-30 13:09:50.688: ERROR/JSON(924):     at
> dalvik.system.NativeStart.main(Native Method)
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

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

Reply via email to