When we want to connect localhost server of laptop or computer server port on Android emulator, we usually try
http://127.0.0.1. But Android emulator cannot access this port. What should I do to connect to the localhost currently running on my computer?
The solution is so simple. You can use
http://10.0.2.2. The emulator (Android) are operating systems. When you call localhost on this emulator, it becomes itself. So even if i call api, i can’t connect to the server.
If you look at the Android Emulator networking settings, it says that you can access it with a special address called