Let me explain the situation:
Web application is running on ubuntu virtual machine (VirtualBox). I can
ping it from my mac. Vm's ip address is 192.168.56.100.
Android device is connected to a mac via bluetooth internet sharing.
I can ping from android to mac. mac's ip address 192.168.65.1.
I can access web application from android if its are running directly on mac (MAMP).
The problem: I need to be able to ping from android device to virtual machine.
Don't know what is the best ways to achieve that. I believe i have to set up some sort of network
bridge or IP forwarding or port forwarding or routing rule to virtual machine.
This is my virtual box network settings:
http://imageshack.us/a/img42/2475/9ufb.png
http://imageshack.us/a/img24/2319/w4nh.png
Tried to make a bridge network adapter to Bluetooth PAN on virtual box setting
Didn't work.
Any help or advice would be appreciated.
Thank you.
Related
We have a continuous integration server as shown in the image and have build agents which are connected to a Android virtual device hosted in the emulator host.
The port of each corresponding emulator is forwarded to the build agent and from the build agent the android virtual device is connected via adb. So each build agent is connected to one virtual device.
I am trying to connect to the host loop back interface from the AVD device with the IP address 10.0.2.2 as described in here.
But the issue is that 10.0.2.2 is not the loop back of the build agent. Instead it is connected to the loop back on the emulator host.
Is there some way to connect it to the loop back of the build agent instead of the emulator host from the android virtual device ?
It is not possible to access it via 10.0.2.2. Instead I had to use the ip address of the build agent to get it working.
I know that when we use a virtual device for testing android applications, we have access to the machine with this IP : 10.0.2.2
But when I use a real hardware phone instead of a virtual one, I don't know how I can access to the machine?
Thanks for any help...
NOTE that currently I can run my applications on the connected phone.
To connect through Wifi
Install connectify software in laptop to make a wifi hotspot. Then connect your phone to this hotspot.
You can find your local network's IP by go to cmd or press Winkey + R then type in "ipconfig". It will give out some information and your local IP should look like 192.168.1.x .
Using this IP you can connect to your local host from your phone
To connect through USB:
You should go for REVERSE TETHERING......
May be these links would help you.
http://www.orclage.com/connect-internet-pc-laptop-android-mobile-phone/
Since off yesterday I'm using Genymotion as Android emulator.
Now I'm running a server on the emulator that listens to connections.
I'm running the client on my real phone on the wireless network.
My client has IP 192.168.0.196 ip address and my emulator has 192.168.56.101 as Ip address.
I also tried the 10.0.3.15 as ip address but that doesn't matter.
Whats the best way to connect my phone to the genymotion emulator?
Thought changing some settings in the virtual box but everytime when genymotion starts the settings are back to default :-).
Change the second network interface in VirtualBox to "bridged". This should enable Genymotion to automatically obtain an address in your local network (you need a DHCP server)
I have a normal simple java program running as a server, waiting for a client to connect with TCP.
On another eclipse project, i'm building an android application. That application has to contact the java program running on the host machine to receive a message.
I can't simply use "localhost" to contact the server becouse, supposedly, the emulator runs behind a virtual router and i'll be accessing the "phone"'s network instead of the host machine's network.
So, what ip should I use to contact the host development machine?
The machine is a linux running on a VirtualBox with an Ip of 10.0.0.5.
I've tried to use that ip on the emulator but even so, I can't establish a connection.
I think you want 10.0.2.2. Check out the Android Emulator Networking documentation:
https://developer.android.com/studio/run/emulator-networking.html
I believe you need to enable port forwarding in order to use any kind of network connection in the emulator. You can do this with the adb tool. Check the Android Developer Guides for details.
I want to connect to my app running in the emulator from another machine on my local network. The ip assigned to emulator is 10.0.2.15 while my host machine has ip 192.168.1.* . Is there any way to run the emulator in bridge mode such that it gets an ip in the range 192.168.1.* ?
The Android Emulator has a virtual router connecting it to the network. You can use the redir command to setup network connections. See this article:
http://developer.android.com/guide/developing/devices/emulator.html#emulatornetworking