Android
Android

Reputation: 145

Want to get php data to android

My LogCat errors are:

    12-31 10:42:42.534: W/dalvikvm(292): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
12-31 10:42:42.544: E/AndroidRuntime(292): Uncaught handler: thread main exiting due to uncaught exception
12-31 10:42:42.764: E/AndroidRuntime(292): java.lang.NullPointerException
12-31 10:42:42.764: E/AndroidRuntime(292):  at com.example.visit.record.My_Task$GetTaskDetails.onPostExecute(My_Task.java:204)
12-31 10:42:42.764: E/AndroidRuntime(292):  at com.example.visit.record.My_Task$GetTaskDetails.onPostExecute(My_Task.java:1)
12-31 10:42:42.764: E/AndroidRuntime(292):  at android.os.AsyncTask.finish(AsyncTask.java:417)
12-31 10:42:42.764: E/AndroidRuntime(292):  at android.os.AsyncTask.access$300(AsyncTask.java:127)
12-31 10:42:42.764: E/AndroidRuntime(292):  at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
12-31 10:42:42.764: E/AndroidRuntime(292):  at android.os.Handler.dispatchMessage(Handler.java:99)
12-31 10:42:42.764: E/AndroidRuntime(292):  at android.os.Looper.loop(Looper.java:123)
12-31 10:42:42.764: E/AndroidRuntime(292):  at android.app.ActivityThread.main(ActivityThread.java:4363)
12-31 10:42:42.764: E/AndroidRuntime(292):  at java.lang.reflect.Method.invokeNative(Native Method)
12-31 10:42:42.764: E/AndroidRuntime(292):  at java.lang.reflect.Method.invoke(Method.java:521)
12-31 10:42:42.764: E/AndroidRuntime(292):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
12-31 10:42:42.764: E/AndroidRuntime(292):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
12-31 10:42:42.764: E/AndroidRuntime(292):  at dalvik.system.NativeStart.main(Native Method)
12-31 10:42:42.784: I/dalvikvm(292): threadid=7: reacting to signal 3
12-31 10:42:42.784: E/dalvikvm(292): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
12-31 10:42:46.564: I/Process(292): Sending signal. PID: 292 SIG: 9
12-31 10:42:47.574: D/dalvikvm(315): GC freed 604 objects / 50648 bytes in 108ms

In my application, I am trying to get data from Mysql database using JSON on php. I code it to get customer name, contact no, ticket no and task details in android using JSONParser. but unluckly not getting appropriate results:( can anyone tell me that where i go wrong and why it not work to get data from database? Does i use any other request in php? kindly review my php code too. I'll be very thankful to you if you point out my error and guide me.

Upvotes: 2

Views: 154

Answers (1)

ρяσѕρєя K
ρяσѕρєя K

Reputation: 132972

here

if(method == "POST")

you are using == for comparing String Contain which is not valid because == is used for Comparing object reference if you want to compare contain value then using String.equals as:

if(method.equals( "POST"))

or using equalsIgnoreCase

if(method.equalsIgnoreCase( "POST"))

Upvotes: 1

Related Questions