Android device connection with localhost server [d

2019-03-21 11:11发布

This question already has an answer here:

I am new at android. I am devloping an app that uses MySQL. The application runs well in the emulator. But now I need to run the app in a android device. What can I do.

标签: android mysql ip
1条回答
ゆ 、 Hurt°
2楼-- · 2019-03-21 11:58

As stated in the first comment, you should check your file AndroidManifest.xml.

In order to access the network, it should contain the following instructions :

<uses-permission android:name="android.permission.INTERNET" />

You may also add the following, which enable your application to know the actual state of the network connection.

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
查看更多
登录 后发表回答