Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have Android App communicate with external MySQL db

I am really confused on how to get data in and out of an android app from the internet.

I imagined that I would store information in the mysql db on the server I already have set up. But from what I have read, I would need some type of in-between web service to make queries with data sent from the app.

Can anybody toss me some tips on how to get something like this started.

Or, if you know of a better way, let me know about it.

like image 522
Adam Tal Avatar asked Oct 09 '10 06:10

Adam Tal


People also ask

Can Android app connect to MySQL database?

This is very useful in case you have a webserver, and you want to access its data on your android application. MYSQL is used as a database at the webserver and PHP is used to fetch data from the database.

How the Android application is connected to external database?

Yes you have to create Web Service to interact with External Database (MySql in your case). Its very easy to create Web service in PHP as its having one function which convert your DB data to JSON and you can easily parse the JSON data and display that in Listview or accordingly your requirement.

Which DB is best for Android app?

A unique relational database, PostgreSQL is the best database for Android and iOS apps. Developers can customize this database as they want; that's why it's the most preferred mobile app database.

Is MySQL good for mobile apps?

MySQL is one of the most well-known SQL databases on the market, so it is also commonly used within the development of mobile applications.


1 Answers

This question has been asked several times, for example here: How to get from a MySql server to an Android app?.

Bottom line - you don't connect directly. You have something on your server (like RESTful) that you connect with via HTTP.

like image 54
EboMike Avatar answered Sep 28 '22 17:09

EboMike