Walidix
Walidix

Reputation: 1277

Android Emulator Networking

How can I make Android Emulator and the host machine (Ubuntu 9.10) connected together to the same network? For example Android Emulator IP Address : 10.0.2.15 Ubuntu Host IP Address: 10.0.2.16

Thanks in advance

Upvotes: 1

Views: 1551

Answers (2)

Espanta
Espanta

Reputation: 1150

Android uses an internal router through which it accesses the host network connection. In that router, there is a firewall to avoid communication to the external world. If you need to enable communication between your emulator and the host, you need to use port forwarding option that is provided in Android emulator. Use telnet localhost port# in Android console. port# is usually appearing in the title bar of the emulator window. Numbers such as 5554, 5556, 5557 and so on.

Use add <protocol>:<host-port>:<guest-port> to define a port forwarding rule for your router. Protocol is udp/tcp and host port is the port of your computer and guest port is the port of your emulator. So, if you want to transfer all the http call to theh ost use add tcp:80:8080

More information is here

Upvotes: 0

user376175
user376175

Reputation: 51

You have to use port forwarding using either 'adb forward' tool of Android or using 'redir add' from the emulator console

Upvotes: 1

Related Questions