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.
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?)
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?
You may want to look at C2DM (http://code.google.com/android/c2dm/).
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.
Try this method out. I will be using this method for the current project i am working on.
You basically create a php script on a server and use http posts to send the data to the script, read the tutorial linked below for better explanation.
mysql/android tutorial
There are many approaches to this, but I would use an SOA.
Your mobile application will need to follow a typical service-oriented architecture (SOA) and
will need three distinct elements: an external database; a web-service; and a mobile web-service client.
You will need to create a web-service using something like Java EE that receives a request from the locally installed android application, and responds with the required data from the external MySql database.
I am using the KSOAP for android libraries to do this, but should ideally be using REST.
Step by step procedure for using Mysql to store data in local machine using android to enter data
Android Connecting to MySQL, PHP
This is one of the simplest tutorials on the net regarding data flow from your Android app to PHP script then finally is stored in your MySQL database.
Hope it helps