-2

How can I connect MySQL and Android? I have MySQL db in remote I want get the values from that database and display those content in Androidlist view. I have tried many web service samples, but I have met some problems.

I have tried this using json and php from this link http://blog.sptechnolab.com/2011/02/10/android/android-connecting-to-mysql-using-php/ , but my app quits

Sathyajith Bhat
  • 20,587
  • 21
  • 94
  • 129
Rama Moorthy
  • 555
  • 1
  • 10
  • 19
  • Please show the exact code you're using and the problem it's giving you. As it is, no one can help you, we don't know what your problem is. – Mat Aug 06 '11 at 10:42
  • use ksoap web service to transfer those data from your database to android device, parse that data and store that data in android database – Abhinav Singh Maurya Aug 06 '11 at 10:57

3 Answers3

2

There is no JDBC driver for android / MySQL. So you can't connect to your database as a desktop application or a web server would.

You then have to write a small interface, typically a web server to make your mysql data available, and then write a small android client, usually parsing xml stuff from your server.

That's the way to go, the very big picture, but your question is vast and fuzzy, that's the best answer I can give you.

Sathyajith Bhat
  • 20,587
  • 21
  • 94
  • 129
Snicolas
  • 37,393
  • 14
  • 110
  • 172
0

There are various way to access mysql database from android.

  1. You can access data from web services for ksoap2-android lib is good fro that. Click for web services example web-services example

  2. You can also use Http connection or socket programming.

Community
  • 1
  • 1
Suresh Kerai
  • 871
  • 1
  • 6
  • 20
0

This have been repeatedly in SO, here a i leave you with some samples

SO

And also in other places,

AndDev

More

But wait there is more :D, on google

enter image description here

Community
  • 1
  • 1
Necronet
  • 6,610
  • 8
  • 47
  • 86