如何从MySql服务器到Android应用程序? [英] How to get from a MySql server to an Android app?

查看:183
本文介绍了如何从MySql服务器到Android应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MySql数据库与一些体育结果。我想写一个Android应用程序,在手机上显示这些数据。

I have a MySql database with some sports results in it. I want to write an Android application to display these data on mobile phones.

我在互联网上搜索过这个问题,我认为这是不可能的在MySql数据库和Android应用程序之间的直接连接。 (这是对吗?)

I´ve searched on the internet for this issue, and I think it is not possible to have a direct connection between the MySql database and the Android application. (Is this right?)

所以我的问题如下:
我如何在Android应用程序中访问MySql数据库,的数据?

So my question is the following: How can I have access in the android application to the MySql database in order to display some of the data?

推荐答案

您可能想看看C2DM( http://code.google.com/android/c2dm/ )。

You may want to look at C2DM (http://code.google.com/android/c2dm/).

方式是写一个REST Web服务,并使用Android调用并从服务器获取数据。

A common way is to write a REST web service and have Android call that and get the data from the server.

如果要推送它,如果数据足够小,您可以使用短信,只需将数据作为文本消息发送到设备。

If you want to push it, if the data is small enough, you could use SMS and just send the data as a text message to the device.

您不想打开对数据库的访问,因此通过使用Web服务可以更好地保护您的数据库。

You don't want to open access to your database so by using the web service you can better protect your database.

这篇关于如何从MySql服务器到Android应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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