Thesteps are: The first one is using when you use your real android for me. Your Second opt is creating hotspot from your pc and connect your android device to the hotspot. Find the ip address using cmd type "ipconfig" replace localhost with the ip address.
Forthe best experience, you should use the emulator in Android Studio on a computer with at least the following specs: 16 GB RAM; 64-bit Windows, macOS, Linux, or ChromeOS operating system;
Raw Enable bridge network android studio emulator.md. sudo ip tuntap add dev tap0 mode tap group kvm sudo brctl addif br0 tap0 sudo ip link set dev tap0 up promisc on #sudo sysctl -w net.ipv4.ip_forward=1.Thenin your emulator, you can access your API service running on host machine, using LAN IP address and binding port: http://: Hope this O1V2.