简体   繁体   中英

What IP address should I use to connect MySQL with Android Device

I'm working with Android Studio (I guess in other IDEs same happens) and I'm trying test my app in device android from USB.

The app work with a mysql database in localhost (local server). When I emulate the app with AVD works fine with IP 10.0.2.2, but when test this in my device doesn't work with IP 10.0.2.2 or 127.0.0.1 or IP Lan 192.168.1.138.

What IP address should I use?

Rather than USB you have to connect your android device in wifi network. And both device and your server PC should be in the same network. Then you can use the IP address of your LAN.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM