【发布时间】:2015-04-20 03:15:39
【问题描述】:
我正在使用以下代码构建一个 android 应用程序:
try{
HttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost("http://10.0.2.2/tut.php");
HttpResponse response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
}catch(Exception e){
System.out.println("Exception 1 caugt");
}
这个应用程序在我的电脑上运行良好。
我希望每个人都下载这个应用程序可以使用它并从 phpmyadmin 读取数据。
谁能教我如何做到这一点?
(我希望可以从公共用户读取 phpmyadmin 中的数据。)
我需要更改代码吗?
HttpPost httpPost = new HttpPost("http://XXXXXXXXX/tut.php");
【问题讨论】:
-
这不是您必须更改的代码,而是您必须在线托管数据库,而不是在您的计算机上本地托管数据库。
-
如何在线托管?我是新手
标签: android eclipse phpmyadmin