I’m developing an Android application that will need to query to an external MYSQL database. To do that, which is the best way to get the best performance and to trying to avoid overcharging of database:
- Do a query directly to MYSQL Database, or
- Do a HTTP POST to a PHP file and do a local query to MYSQL Database (note that using this way I can control the input and play with it before doing the query)
Here is a complete solution for you to connect your application to MySQL database by using JSON and PHP. You can do scripting in PHP page before executing query. Visit this page,
http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/