Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access online mysql database in android?

I have created an online database about the restaurants and I need to access this database through my android application, so that I can display the data to the users after filtering. My application does not need to update the database, but my problem is how to connect to my online mysql database and provide it to the users? I have looked on many suggestions on this site as well as on others, and I just found I have to use JSON parser while accessing but do not how to do it.

like image 407
Jivan Avatar asked Jul 04 '12 08:07

Jivan


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.

Can I use JDBC in Android?

The JDBC API is an alternative to the drop-in replacement. It is possible to build Berkeley DB SQL for Android in such a way that a JDBC API is exposed to Android application developers. This is done using the Android NDK. This section describes how to build and use the BDB JDBC driver for Android.


2 Answers

The best solution is provide a public API, managed for example with PHP, which delivers your database data filtered and displayed as your Android application needs.

like image 78
Stefano Ortisi Avatar answered Oct 04 '22 21:10

Stefano Ortisi


This link might help you . http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/ Just get an understanding of JSON parsers and how it can be used in android for retrieving data from database on server... you can write webservices in php..

like image 44
Cool Compiler Avatar answered Oct 04 '22 22:10

Cool Compiler