与本地主机服务器的Andr​​oid设备连接 [英] Android device connection with localhost server

查看:117
本文介绍了与本地主机服务器的Andr​​oid设备连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的机器人。我发民是使用MySQL的应用程序。该应用程序在模拟器中运行良好。但现在我需要在Android设备上运行的应用程序。我能做些什么。

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.

我用

private static String gethall = "http://10.0.2.2/theater_details/theater.php";

我能做些什么?

What can I do??

推荐答案

作为第一个注释说明,你应该检查你的文件的Andr​​oidManifest.xml。

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

这篇关于与本地主机服务器的Andr​​oid设备连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆