Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to create android apps which are able to send data through wifi connection to my laptop Apache Server and MySQL database. I use the samsung galaxy tab 10.1 as my mobile device. and the protocol i used is HttpGet or HttpPost. And i use XAMPP( with Apache& SQL) to do the server and process the php. But, since android cannot detect adhoc network from laptop, I use Virtual Router ( for windows 7) to create virtual access point and make the tablet able connect to my laptop. But the problem is:

  1. in my apps (client-android), where the httpget or httppost to which url? localhost in my laptop- 127.0.0.1 or localhost in android 10.0.0.1 or the ip address of the virtual router?

  2. If I want access from android to the localhost(laptop-Apache) to call the php to run? which port? which ip address /url that I need to put in android apps(httpget)? and do I need to modify anything in httpconfig for XAMPP?

share|improve this question

1 Answer 1

I think with your first question, you're asking how to contact your laptop's Apache web server from the Android device.

Since you set up the virtual hotspot on your Windows 7 machine, that is an additional interface that your laptop is using, which means that interface has an IP address of its own. On your laptop, go to command line and do ipconfig, and look through the results for something like Virtual Wifi Adapter and see what IP it's showing. That's the IP that the Android device will use to reach your laptop, since they're on the same network.

Regarding the second question, you'll have to consult XAMPP documentation and your configs to make sure the Apache server is listening for connections outside of localhost and to see which port it is listening on.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.