Android login registration with php mysql – Here, I share with you how to connect android with PHP & MySQL in on e example like Login and Registration form. This is very simple example so everyone easily develop this tutorial without any error. You have just follow my tutorial to connect PHP & MySQL and make with example of registration form.
Android login registration with php mysql

I have already launch one article for connect PHP MySQL with user registration form but that’s not android studio, the platform is PhoneGap. But the both are same way to make android app. You could be make hybrid application using PhoneGap so this is one of the advantage in PhoneGap platform. The article is Login Registration PhoneGap using PHP MySQL

Android Login Registration form PHP MySQL

Let’s start our tutorial to connect PHP MySQL and make an registration form. First you have to create PHP file for connect the database and registration form. Create the php file and uploaded in server. We have directly call from the php file server. So you have first complete the php & mysql code then move on the Android code.

Develop PHP & MySQL code

Now create one config.php file then write the code of php mysql connectivity. The code is look like,

After connecting database, create registration form and connect the configuration file. Then create the registration.php file and write the registration code in php. The code is look like,

Now you have upload these files in server and call from android code to perform the registration form. Below i have include the files so you have click to download the PHP files and uploaded from server.

Android Development code

Now time to move on the android code development. We have already complete the php code so now just call the php code from server.

Create New Android Project

First create new android project then open the activity_main.xml and replace the below code.
The activity_main.xml file look like,

Its look like,

Android login registration with php mysql

Then move on the MainActivity.java file and replace the following code. The code is,

Its look like,

Then add the internet permission in AndroidManifest.xml file.

Finally add the label name in strings.xml. The code is

Its look like,

Android login registration with php mysql

that’s all.

Execute Application

Now time to run your application in android emulator or other Virtual Device. I have used Genymotion and the output like,

Android login registration with php mysql