Reputation: 1831
I want to connect Ethernet to android device and check it's properties. For example NetworkInterface networkInterface = NetworkInterface.getByName("eth0");
But currently I don't have Ethernet to USB connector. Is it possible to check with android emulator? Is it possible to connect emulator by Ethernet? I tried something. But In emulator I can use WiFi or Mobile data only. Please let me know how to connect via Ethernet.
Upvotes: 1
Views: 654
Reputation: 3268
As said in the Android documentation:
"Each instance of the emulator runs behind a virtual router/firewall service that isolates it from your development machine network interfaces and settings and from the internet. An emulated device can't 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. [...] All addresses managed by the router are in the form of 10.0.2.xx, where xx is a number. Addresses within this space are pre-allocated by the emulator/router as follows:"
Upvotes: 1