Issue
My local environment is a Windows 7 with Eclipse, I installed Android SDK and created an Android Virtual Device(AVD) for testing web pages purposes.
My development environment is on a Virtual Machine(VMWare) with CentOs(LAMP).
I create a responsive web application, and i need connect from the Android Browser(ADB/Chrome) to the IP of the virtual Machine(Apache) to view web application and test the responsive design.
I tried with this IP's with no luck:
- 127.0.0.1
- 10.0.2.2
- 192.168.245.128(IP of the Virtual Machine)
Solution
You must configure vmware in Bridge mode (the IP of the virtual machine should be in the same range than the IP of your physical machine).
Then the Android documentation says 'An emulated device can not see your development machine or other emulator instances on the network. Instead, it sees only that it is connected through Ethernet to a router/firewall.' (http://developer.android.com/tools/devices/emulator.html#emulatornetworking) so even with that this might not work, all depends if another virtual machine on a bridged network is considered 'outside' your machine.
If it does not work, you can run the emulator on the CenOS virtual machine.
You might also create a proxy on the PC, I suspect 10.0.2.2 will be the Windows machine, you can make a small program to bind/listen/accept here, connect to the CentOS machine and then pass packets back and forth. netcat would do that on linux, there is probably an equivalent for Windows.
My last approach would be to use a Virtual Private Server (VPS) for the CentOS host. http://lowendbox.com/ have cheap ones.
Answered By - Nicolas Defranoux
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.