English 中文(简体)
访问数据库或网络服务
原标题:Accessing database or webservice

I want to access an online MySQL database in order to retrieve and manipulate data. I read that the best way would be implementing an own web-service, which returns XML and then parse it in Android, is it right?
Does anybody have a basic tutorial?

最佳回答

Since you want to access a remote server which has your DB and other stuff. You basically have two options.

1) 通过插座等直接访问您的服务器。

2- 或创建一个网络服务,将您的服务器与外部连接。 (例如:Android客户端、iOs客户端等)

最佳做法是创建网络服务,然后在 Android应用中将其消耗掉。

检查这些在Android消费XML。

http://www.ibm.com/developmenterworks/opensource/library/x-android/"rel=nofollow>http://www.ibm.com/developerworks/opensource/library/x-android/

http://www.warriorpoint.com/blog/2009/07/19/and milid-reading-widing-useing-and-work-wiking-ing-ing-and-work-wiking-wiking-wiking-ing-dml-data-data-and-web-services-in-and-and-roid/

检查这些以在服务器一侧创建网络服务 。 (桌面独立)

http://davidwalsh.name/web-service-php-mysql-xml-json (菲律宾人民党)

http://www.roseindia.net/webservices/buildingspurewebservice.shtml (贾瓦)

http://www.codeguru.com/csharp/cs_webservices/article.php/c19391/Createting-a-NET-Web-Servicice.htm (.NET)

因此,有很多堆叠 来创建网络服务。

问题回答

同样,WebService是最好的方法。但您必须依据从服务器上检索的数据数量以及交易需要与服务器同步的频率来做出决定。

Arvind试图解释的是,如果数据量太大,无法通过网络服务下载,那么你可能需要考虑一些中层,将他的数据转换成json,然后将其发送到设备。如果你在空气中传输1k的肥皂反应,为了同样的响应,如果你在传输troojson,那么它可能是100k或200k或300k的。这样,你可以将传输费用节省到网络上,转回时间更快。





相关问题
what is wrong with this mysql code

$db_user="root"; $db_host="localhost"; $db_password="root"; $db_name = "fayer"; $conn = mysqli_connect($db_host,$db_user,$db_password,$db_name) or die ("couldn t connect to server"); // perform query ...

Users asking for denormalized database

I am in the early stages of developing a database-driven system and the largest part of the system revolves around an inheritance type of relationship. There is a parent entity with about 10 columns ...

Easiest way to deal with sample data in Java web apps?

I m writing a Java web app in my free time to learn more about development. I m using the Stripes framework and eventually intend to use hibernate and MySQL For the moment, whilst creating the pages ...

join across databases with nhibernate

I am trying to join two tables that reside in two different databases. Every time, I try to join I get the following error: An association from the table xxx refers to an unmapped class. If the ...

How can I know if such value exists in database? (ADO.NET)

For example, I have a table, and there is a column named Tags . I want to know if value programming exists in this column. How can I do this in ADO.NET? I did this: OleDbCommand cmd = new ...

Convert date to string upon saving a doctrine record

I m trying to migrate one of my PHP projects to Doctrine. I ve never used it before so there are a few things I don t understand. In my current code, I have a class similar to this: class ...

热门标签