Android device connection with localhost server [duplicate]

天涯浪子 提交于 2020-01-01 03:31:10

问题


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.


回答1:


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" />


来源:https://stackoverflow.com/questions/21252879/android-device-connection-with-localhost-server

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!