Reputation: 885
I simply have a small question..
I was wondering about Android connection with MySql , As I know there is no any direct connection between Android with MySql, we need to use JSON or any other library to connect. Well using JSON and configure it with some PHP files, is this the only way we can get and query datas from mysql,so far, and is it desirable this way??? or there are some other way how to get the datas from mysql into listview or wherever in Android?
Thanks,
Upvotes: 0
Views: 1140
Reputation: 12221
You can deploy the mysql JDBC driver into your Android application. There are several blogs that show you how to do it. How functional it will be I can't tell. Just keep in mind that if you want Android devices to connect to your mysql server directly you need to expose the mysql server to the internet directly. This is generally not recommended. Also the data flowing between mysql and the device will be unencrypted.
Essentially doing this moves your architecture back to client server model. If you later wanted to support iPhones, blackberry or Windows mobile you will have to make those devices also connect directly to mysql. By using a webservice or even your own custom developed server you can remove the dependency on the MySQL driver. In the long run this will probably be a better model to follow.
The choice is yours however.
Upvotes: 1