Note that there are some explanatory texts on larger screens.

plurals
  1. POConnection to database mySQL failed from android
    text
    copied!<p>am working on an android project, when i tried to login the application using a php file and easyphp/mySQL, it fails, here's the logcat errors:</p> <pre><code> 08-03 04:53:20.203: W/System.err(244): org.apache.http.NoHttpResponseException: The target server failed to respond 08-03 04:53:20.237: W/System.err(244): at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:85) 08-03 04:53:20.247: W/System.err(244): at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:174) 08-03 04:53:20.247: W/System.err(244): at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:179) 08-03 04:53:20.247: W/System.err(244): at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:235) 08-03 04:53:20.260: W/System.err(244): at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:259) 08-03 04:53:20.260: W/System.err(244): at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:279) 08-03 04:53:20.260: W/System.err(244): at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:121) 08-03 04:53:20.282: W/System.err(244): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:410) 08-03 04:53:20.288: W/System.err(244): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) 08-03 04:53:20.300: W/System.err(244): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487) 08-03 04:53:20.307: W/System.err(244): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465) 08-03 04:53:20.320: W/System.err(244): at com.stage.sondage.Login.onClick(Login.java:109) 08-03 04:53:20.320: W/System.err(244): at android.view.View.performClick(View.java:2364) 08-03 04:53:20.339: W/System.err(244): at android.view.View.onTouchEvent(View.java:4179) 08-03 04:53:20.358: W/System.err(244): at android.widget.TextView.onTouchEvent(TextView.java:6540) 08-03 04:53:20.358: W/System.err(244): at android.view.View.dispatchTouchEvent(View.java:3709) 08-03 04:53:20.367: W/System.err(244): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 08-03 04:53:20.379: W/System.err(244): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 08-03 04:53:20.387: W/System.err(244): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 08-03 04:53:20.401: W/System.err(244): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 08-03 04:53:20.401: W/System.err(244): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 08-03 04:53:20.401: W/System.err(244): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 08-03 04:53:20.407: W/System.err(244): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659) 08-03 04:53:20.420: W/System.err(244): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107) 08-03 04:53:20.420: W/System.err(244): at android.app.Activity.dispatchTouchEvent(Activity.java:2061) 08-03 04:53:20.420: W/System.err(244): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643) 08-03 04:53:20.420: W/System.err(244): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691) 08-03 04:53:20.427: W/System.err(244): at android.os.Handler.dispatchMessage(Handler.java:99) 08-03 04:53:20.438: W/System.err(244): at android.os.Looper.loop(Looper.java:123) 08-03 04:53:20.459: W/System.err(244): at android.app.ActivityThread.main(ActivityThread.java:4363) 08-03 04:53:20.459: W/System.err(244): at java.lang.reflect.Method.invokeNative(Native Method) 08-03 04:53:20.459: W/System.err(244): at java.lang.reflect.Method.invoke(Method.java:521) 08-03 04:53:20.459: W/System.err(244): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 08-03 04:53:20.467: W/System.err(244): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 08-03 04:53:20.517: W/System.err(244): at dalvik.system.NativeStart.main(Native Method) </code></pre> <p>the line 109 in login is <code>response = hhtpclient.execute(httppost);</code></p> <p>where response is an instance of HttpResponse; and i have tried with both values</p> <pre><code>httppost=new HttpPost("http://10.0.2.2/android/connection.php"); </code></pre> <p>and </p> <pre><code>httppost=new HttpPost("http://127.0.1.1/android/connection.php"); </code></pre> <p>( by the way what's the difference between the two ip adresses?)</p> <p>thanks,</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload