Android PHP MYSQL Database Example

This tutorial teaches you how to integrate PHP and MYSQL with your android application. 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 a Scripting Language which we use to fetch data from the database into JSON format .

We will create a server side script using PHP which will get data from a MySQL database into JSON format. After that, we consume the JSON data into the Android client application. This is how we can connect Android with PHP and MySQL.

Setting-Up  Server

You need a Hosting Server account or you can also use your local wamp server (Install WAMP, XAMPP into your PC) .

I am using as my hosting server , where i will setup mysql database and also place php scripts .

  • Firstly Sign into .
  • Request for free hosting account with a free sub-domain .
After logging into your account successfully just follow below steps to set up .

Setting Up MySQL Database 

Placing PHP Scripts 

Below Screen Shows how and where to place the php scripts

Android PHP CRUD Operation

Android PHP tutorial is divided into 4 parts .
  1. Android PHP Insert Into MYSQL Database.
  2. Android PHP Read From MYSQL Database.
  3. Android PHP Update Into MYSQL Database.
  4. Android PHP Delete From MYSQL Database.

Demo Video of Final Output



  1. Very helpful and Appreciated Work

  2. good work thanks
    same tutorial use retrofit and okhttp post here