Currently, the emulator cannot use the host's network for Internet connectivity. Therefore the apps developed on the emulator cannot "out-of-the-box" connect to Internet services.
However, there are 2 workarounds:
- if you want to connect to a network service on your host you can use "adb forward" to do port-forwarding (see Access the services of a Virtual Device)
- you can install https://github.com/Genymobile/gnirehtet and both, the TCP (Transfer Control Protocol) and UDP (User Datagram Protocol) connectivity to the Internet will work
Our investigation has shown that this issue is fixed in a newer emulator version (Android 9 and above) and this will be included in one of our next Android Virtual Device (AVD) releases.