am working on an android application, for the login part there’s no error detected on eclipse, but the connection is not established with the mySQL database. here’s the log file
08-02 16:25:58.063: I/global(236): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
08-02 16:25:58.074: W/System.err(236): org.json.JSONException: A JSONObject text must begin with '{' at character 1 of <br />
08-02 16:25:58.084: W/System.err(236): <b>Parse error</b>: syntax error, unexpected '{' in <b>C:\Program Files\EasyPHP-12.0\www\Android\Connection.php</b> on line <b>36</b><br />
08-02 16:25:58.093: W/System.err(236): at org.json.JSONTokener.syntaxError(JSONTokener.java:448)
08-02 16:25:58.093: W/System.err(236): at org.json.JSONObject.<init>(JSONObject.java:178)
08-02 16:25:58.103: W/System.err(236): at org.json.JSONObject.<init>(JSONObject.java:246)
08-02 16:25:58.113: W/System.err(236): at com.stage.sondage.Login.onClick(Login.java:128)
08-02 16:25:58.124: W/System.err(236): at android.view.View.performClick(View.java:2364)
08-02 16:25:58.124: W/System.err(236): at android.view.View.onTouchEvent(View.java:4179)
08-02 16:25:58.124: W/System.err(236): at android.widget.TextView.onTouchEvent(TextView.java:6540)
08-02 16:25:58.143: W/System.err(236): at android.view.View.dispatchTouchEvent(View.java:3709)
08-02 16:25:58.143: W/System.err(236): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-02 16:25:58.153: W/System.err(236): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-02 16:25:58.153: W/System.err(236): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-02 16:25:58.163: W/System.err(236): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-02 16:25:58.163: W/System.err(236): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-02 16:25:58.163: W/System.err(236): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-02 16:25:58.163: W/System.err(236): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
08-02 16:25:58.186: W/System.err(236): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
08-02 16:25:58.203: W/System.err(236): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
08-02 16:25:58.213: W/System.err(236): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
08-02 16:25:58.213: W/System.err(236): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
08-02 16:25:58.223: W/System.err(236): at android.os.Handler.dispatchMessage(Handler.java:99)
08-02 16:25:58.250: W/System.err(236): at android.os.Looper.loop(Looper.java:123)
08-02 16:25:58.253: W/System.err(236): at android.app.ActivityThread.main(ActivityThread.java:4363)
08-02 16:25:58.253: W/System.err(236): at java.lang.reflect.Method.invokeNative(Native Method)
08-02 16:25:58.253: W/System.err(236): at java.lang.reflect.Method.invoke(Method.java:521)
08-02 16:25:58.253: W/System.err(236): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-02 16:25:58.253: W/System.err(236): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-02 16:25:58.253: W/System.err(236): at dalvik.system.NativeStart.main(Native Method)
08-02 16:25:58.273: I/NotificationService(60): enqueueToast pkg=com.stage.sondage callback=android.app.ITransientNotification$Stub$Proxy@44e77500 duration=0
I hope to hear from good tips soon. Thank you for reading my question.
-Asmae
Without seeing the offending code it’s hard to say without any real certainty, but the error looks like its coming from the page itself. Make sure you are connecting to the right url and giving it all the parameters. The fact that its getting to the JSON parsing suggests that it is at least connecting to the site.
this error
is almost definitely from php itself.