连接到外部数据库 - Android应用程序 [英] Connecting to external database - Android application

查看:184
本文介绍了连接到外部数据库 - Android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了我的第三期项目的应用程序。该应用程序将需要与外部MySQL数据库的交互。该应用程序会从数据库中检索数据,并将其显示在一个ListView用户。

I am writing an application for my third year project. The application will require interaction with an external mySQL database. The application will retrieve data from the database and display it to the user in a ListView.

我有什么样的功能,应用程序都将有一个不错的主意。我也花了很多时间与列表视图和本地SQLite数据库的工作。我也做了一些启发式算法进的HttpURLConnection类。

I have a good idea of what sort of functionality the application is going to have. I also have spent a lot of time working with ListViews and the local SQLite database. I also did a bit of reserach into the HttpUrlConnection class.

我只是想知道会有人能够给我多一点指导,我怎么可能去访问这个外部数据库?

I am just wondering would anyone be able to offer me a little bit more guidance as to how I might go about accessing this external database?

它会牵扯我不得不写一个Web服务来处理交易?如果是的话什么涉及,因为我还没有在我的过程中遇到的网络服务,只是还没有。

Will it involve me having to write a web service to handle the transactions? and if so what would that involve as I have not encountered web services in my course just yet.

任何意见将是多少AP preciated。还有我的应用程序的目的是对ICS V4.0.4使用。

Any advice would be much appreciated. Also my application is intended for use on ICS v4.0.4.

谢谢大家!

推荐答案

是的,你必须(在你的情况下,MySQL的)创建Web服务与外部数据库交互。它很容易在PHP创建Web服务作为它有一个功能,你的数据库的数据转换成JSON,你可以轻松地解析JSON数据并显示在列表视图或相应的要求。

Yes you have to create Web Service to interact with External Database (MySql in your case). Its very easy to create Web service in PHP as its having one function which convert your DB data to JSON and you can easily parse the JSON data and display that in Listview or accordingly your requirement.

下面是这将有助于你得到更多的细节了一些有用的链接: -

Here are some useful link which will help you to get more details :-

<一个href="http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/">http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/ - 最好从所有

<一个href="http://www.$c$crzheaven.com/2011/04/08/android-phpmysql-connection/">http://www.$c$crzheaven.com/2011/04/08/android-phpmysql-connection/

<一个href="http://blog.sptechnolab.com/2011/02/10/android/android-connecting-to-mysql-using-php/">http://blog.sptechnolab.com/2011/02/10/android/android-connecting-to-mysql-using-php/

希望它帮助。

这篇关于连接到外部数据库 - Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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