0

My question is simple, almost all the answers I find have been deprecated. What is currently the best way to connect an Android App to a MySQL database?

sbowde4
  • 767
  • 1
  • 4
  • 23
  • 2
    Take a look [at that](http://stackoverflow.com/a/26471486/2256527) – maxoumime Feb 23 '17 at 23:34
  • 2
    Possible duplicate of [Can we connect remote MySQL database in Android using JDBC?](http://stackoverflow.com/questions/26470117/can-we-connect-remote-mysql-database-in-android-using-jdbc) – maxoumime Feb 23 '17 at 23:35

2 Answers2

3

I once created an application following this tutorial on Youtube How to Connect Android with PHP, MySQL - Best Android Studio Tutorial

I would like you to watch this, it is gonna help you a lot.

Please let me know if it helps you!!!

Saarang Tiwari
  • 291
  • 2
  • 12
1

I believe the general opinion will be any kind of api to mediate between the database and the app. Never connect directly to it. A REST api served by a php server should make it, given you added the php tag on purpose

nico91
  • 86
  • 8
  • 1
    I did add php on purpose, my project has a fully functioning php website, and I am attempting to create an app for it now. I know not to connect directly to the databse, but the tutorials I found using a web service use deprecated code. – sbowde4 Feb 23 '17 at 23:32
  • 1
    Have you read this? http://www.androidhive.info/2012/01/android-json-parsing-tutorial/ – nico91 Feb 23 '17 at 23:35
  • 1
    I have created a PHP script "api.php" that will take care of exposing your MySQL through a REST API via PHP, see [this repo](https://github.com/mevdschee/php-crud-api/) on Github. – mevdschee Mar 03 '17 at 13:18