Your API works on the emulator because it maps localhost to your PC, but on a physical device, use your PC’s local IP instead of localhost and make sure the firewall allows the port.