如何建立在Android的与远程数据库的连接? [英] How to set up a connection with remote database in android?
问题描述
能否请你告诉我,我怎么可以与远程数据库中的Android应用程序的简单连接?基本上,我想保存的用户名,电子邮件等在远程数据库中,以后再取他们的需求。在回答 - 你能提供给我一些示例code,所以我可以找出自己好吗?在此先感谢!
Can you please tell me how can I make a simple connection with remote db in android app? Basically, I want to save users names, emails etc. in a remote database and retrieve them later on demand. When answering - could you provide me some sample code so I can figure it out myself please? Thanks in advance!
推荐答案
我想你可以使用普通的Java库建立与数据库的连接。但是,你的工作在移动设备上,这意味着你有一个恒定的连接中断等打开较长的时间可能很难用这种网络问题的数据库连接工作。
I guess you could use common Java libraries to create a connection to a database. But you are working on a mobile device, this means that you have to work with constant connection interruptions etc. A database connection that is opened for a longer time can be difficult with this kind of network issues.
我建议有一个简单的(也许基于REST)的Web服务,可以让您通过简单的短暂的HTTP请求提供输入到数据库。
I would suggest to have a simple (maybe REST based) web service that lets you provide the input to the db via a simple short lived http request.
这篇关于如何建立在Android的与远程数据库的连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!