Android Login and Signup with PHP MySQL

Email and Mobile Number validation in Android.The login and registration is most efficient way to keep user information of an App. In this tutorial we will learn about Android Login and Signup with PHP MySQL using Volley library.  We will use PHP and MySQL for development of Web Services and test it into Postman

1. Develop Web Services 

1.1 Create Table: First of all we have to develop an API to provide a medium of communication between server and Application. Now we are creating a table in our database  by executing following queries.

1.2 Database Connection: To store and retrieve data from the database we need to established database connection. Create a filename with connection.php and write your hostname, user name, password and database name. Now upload it to the server and run it if you find blank page it means your connection is established otherwise connection failed.

1.3 User Signup: Now create a signup.php file for user registration. Here we are using name, email, mobile and password to signup.

1.4 User Login: The user will can login using mobile number and password. If the user request is authenticated login will successful and we will get JSON response of user details other wise login failure.

This is the first part of login and signup with php in Android. Now we will learn about how to develop a simple Login and Signup App in Android.

2.1 First of all we have to add two libraries in  build.gradle of our App. We are using two libraries one is Volley library for network communication and other is hdodenhef for circular image.

2.2 Now add internet permission in AndroidManifest.xml file.

2.3  We will use two colors in our App. Add this colors  in colors.xml.

2.4 In our file we have used some constants values to check validation of email, mobile and internet connection. You can check about validation of email and mobile from Email and Mobile Number validation in Android.

2.5 This is our XML file of Signup Activity.

2.5 This is our file of Signup Activity.

2.6 This is our XML file of Login Activity.

2.7 This is our file of Login Activity.

2.8 After Login the user will move to Main Activity where we will show user’s name, email and mobile.

2.9 This is we are getting data from LoginActivity and showing in Textview.

This is all about Login and Signup with MySQL in Android. You can download full code from Github. you can check other tutorials as well.
Android Spinner
Populate Android Spinner from JSON data