How to get from a MySql server to an Android app?(如何从 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.
您不想开放对数据库的访问,因此通过使用网络服务可以更好地保护您的数据库.
You don't want to open access to your database so by using the web service you can better protect your database.
这篇关于如何从 MySql 服务器到 Android 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何从 MySql 服务器到 Android 应用程序?


- Android - 拆分 Drawable 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01