I want to get data from table in MySQL and to show it in TextView, but I have some problems when I try to connect with database.
I'm using Eclipse for Android, and when I try to get data from MySQL in Java Project it works, but when I use Android Project it doesn't work.
Does anyone know how can I connect MySQL with Android Project using MySQL JDBC driver?
Or to give me other advice how to connect Android Project with MySQL?
解决方案
Android by default does not support MySQL. It has an in-built database i.e SQLite.
If you are trying to access MySQL database remotely, you should expose interface to this database with any standard web service.
E.g you could create RESTful Web Service on Server Side which is written using Java/PHP etc. and MySQL Connector. (Which you have already done!)
And your Android App could talk to this service with the URL generated using this web service.
Again, this question has been repeated previously, so you can check those solutions.