Hi!
I'm trying to show my DB's records on my emulator/android (Samsung GSII).
But first I want to test my HTTP connexion, so I first start with a simple HelloWorld.php (a PHP script) that should show 'Hello World'.
So here's where I'm stuck:
http://192.168.1.10/android_connect/test.php works awesome on my Mozilla browser (it's showing the 'Hello World').
But when I build the projet, it says on my emulator : "The application projet1 stopped".
Anyone to help me please? Thanks in advance!
PS : I already added this on my manifest:
I'm trying to show my DB's records on my emulator/android (Samsung GSII).
But first I want to test my HTTP connexion, so I first start with a simple HelloWorld.php (a PHP script) that should show 'Hello World'.
So here's where I'm stuck:
Code:
package sim.projet;
import java.io.IOException;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
public class Projet1Activity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Creating HTTP client
HttpClient httpClient = new DefaultHttpClient();
// Creating HTTP Post
HttpPost httpPost = new HttpPost("http://192.168.1.10/android_connect/test.php");
// Making HTTP Request
try {
HttpResponse response = httpClient.execute(httpPost);
// writing response to log
Log.i("Http Response:", response.toString());
} catch (ClientProtocolException e) {
// writing exception to log
e.printStackTrace();
} catch (IOException e) {
// writing exception to log
e.printStackTrace();
}
}
}
But when I build the projet, it says on my emulator : "The application projet1 stopped".
Anyone to help me please? Thanks in advance!

PS : I already added this on my manifest:
Code:
<uses-permission android:name="[COLOR=#8B0000]android.permission.INTERNET[/COLOR]" />

