Q:

How to get data from MySQL database to Android app

From my android app I want to get some data from my table containing two columns in my online MySQL database. Could someone explain me how to write a PHP script or something what I need that would respond to a call from my Android application by getting some values from my database and returning it to my app? And then how to call that function from my application and how to handle (save in my app) the returned data? HUGE HUGE THANKS in advance!

A:

There's not a built-in MySQL connector for the Android framework, and even using an external jar for this is discouraged. The best way you can accomplish this is via a webservice in the remote server, so instead of sending direct MySQL queries to a database, you'd send a HTTP POST to the remote webserver (for instance, written in PHP, Python or whatever you want) and this would connect to the local database and make the query.
I think this example might help you.

