I am developing an app in Android, and the emulator is not connecting to my localhost. I have researched the issue and found some ideas but nothing seems to be working.
Below is the code i have been using:,
HttpClient httpclient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost("http://10.0.2.2/YES_BUTTON.php"); httpclient.execute(httpPost); I have also tried a connection using "http://10.0.2.2:3128/YES_BUTTON.php", specifying the port 3128 for Apache.
The code would run a php/sql file, but nothing happens, I have also checked the server access log and no connection was ever made with the Apache server from the emulator.
This is my first time building an app, and was wondering if there was something I haven't done, do I need to map the emulator port with the 3128 port on Apache, disable the firewall? I am developing the app on a laptop,with the Apache Server on the laptop also, so everything is being done on the same machine. Is there anything I havent done that needs to be done? I am not using a proxy and don't have a firewall setup. I can also access the Internet through the Emulator, Any ideas?
Much Appreciated, Graeme.