Android Login/Registration with MySQL Database Example Using Retrofit

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys once again welcome back to another Android application development tutorial in this video here I am going to create a simple Android application that demonstrate how to place a new user registration and login form in your Android application with a remote database so here the remote databases MySQL database and here we are going to use a profit for the network transactions so before going to start the development here I am going to show you the extract Android app that we are going to make now so here is the application so this is our database on the remote server here we have a database called the user DB in that database we have a table called the login info now there is currently there is no informations are available on the database so here the here the table contain three columns a name username and user password ok so now we can open the application on the virtual device so this is the application so if you open the application for the first time it will display a login form so if you didn't register to the application net you can create a new user account by clicking this text to view so from the registration form you can create a new user so here I am going to create a new user specify the name of the user now specify a username now specify a password for the user where I specify the password as password 1 2 3 and click register so now the applications of registration success so now we can check the database so here and there is a new user added to the database this is the name username and password so now I try to register the same user again I will specify the same username publish one two three that is the user name and specify some password and try to register so here the application source user already exists on the database so now we can try to log in first here I end up some wrong information so this is wrong information and try to login so here the login failed now try to enter the valid information so here the user name is pravesh 1 2 3 that is the correct username now specify the password here the password is password 1 2 3 now try to login so here the login success and here is a welcome page so now I remove the application from the memory and try to open the application again so instead of display login page it will display the Welcome page now I try to logout from the application so now I remove the application from the memory now try to login so in that case it will display the login page again so this is the application now we are going to make so here how we are going to perform the user login and user registration with a remote server and we are going to use retrofit for the network operations and here I'm going to use my localhost as web server in this project I'm going to working with a vamp server application so the first thing we have to create the server-side components so we need an IP I that support user login and user registration so we need to create the database we have to place the need at PHP script in server-side to perform the user login and user registration so here the one server is already running so first here I am going to create the database in localhost so open browser and type localhost so this is the home page of our server now here I'm going to create your database in MySQL so open PHP myadmin here my user name is blemish specify my possible so now I'm going to create a new database here so create a new database specify the database name here I name it as a user DB so here the database is created now we need to create a table in that database so here I'm going to create a table with the four columns first one is ID second one is name of the user tilde one is user name and last one is user password so specify the table name here I named it as login info and that table needs four columns and now we can specify the table structure so the first column is ID it is of integer type specify the length of that variable I specify that one into Auto increment and that is the primary key now specify the second column name here it is name specify the data type specify size now here is the tilde column name it is user name specify the data type specified the size and here is the last two column name user password that is also what cannot specify the data type okay now we can create it so now here the table is created our table contain four columns ID name username and user password so now the database is ready now we can start with the server-side scripts so for that go to the installation folder of one server go to the public directory so for our project here I'm going to create a new folder called the log in app this is the folder for our application so here I already created the needed PHP script for server-side so the first thing we have to establish a connection to the database for that here I create a separate PHP script or than in it dot php' a copy that PHP script place it inside the server so this is the PHP script that establish a connection to the database so I will show you the content of this PHP script so this is the PHP script that we are going to use for establish connection to the database so here the host is localhost here in the username this is the username for the MySQL database this is the password and specify the database name so here our database name is you sir DB you serve DB that is the database name so this is the statement but establish connection to the database so here we call a function called MySQL a connect in that function you need to pass parameters like a host name username password and database name so this statement establish a connection to the database and save that connection to this variable called the coem so here we check the connection success or not so if the available connection is true in the case connection success otherwise it is failed so before going to use this PHP script we can test it so open your browser so in localhost we create a folder called the log in up in that folder in that file our PHP script is in it dot PHP and here it shows connection succeed so this is success so now there is no need of this check it is already something ok save it so this is the PHP script that established connection to the database now we need to place angle PHP script that perform the new user registration for that here I already created the needed PHP script so this is all scripts a register dot PHP I copy that PHP script place it inside the solver folder so now the this is the PHP script that performed a new user registration so now I can explain that PHP script for you so this is the PHP script that established that create a new user so first thing we how to establish a connection to the database that's why we include the file in each dot PHP so here for this file we need three parameters first one is name of the user our username and user password that means when a user create a new account the user has to enter his name username and user password in the Android application so the Android application will send the request to the server but the requests contain three parameters three variables a name username and user passwords we save all that information into this variables called the name you suddenly man user password so first we have to check whether that particular user already registered or not for that here I create an SQL statement select star from login in for this is or table name word username equal to the variable username that means if the user already exists in that table that is some result so here we execute that is ql by calling this function mysql like curry and the first parameter is the connection and second parameter is the SQL query so here we check the condition if the mysql my number of rows of that particular result is greater than zero that means that particular user is available on the database in that case we change available status into exists otherwise that means if the user is not available in database we have to perform the new user registration for that here i create another SQL statement inserting the login info specify the column names and specify the values here the values are named user name and user password now we need to insert the data for that here i used the statement mysqli curry for that function you need to pass two parameter correction and SQL Curie so if it will turn true that means the database is of data successfully in that case the available status into okay otherwise if there is an error occur we place the status into error not willing to send the information back to the Android application so here the response from somebody said JSON format so here we create we create a name value pair response into status now we need to perform the JSON encode so here the jason there is only one JSON object with only one parameter it is a response okay and finally we close the MySQL line connection so this is top PHP script that create a new user so before going to use this PHP script with our Android application we have to test it whether it worked fine or not for that here I create a simple HTML form so here likely it's a simple HTML from called register test I copy that HTML form put it in our server so now I am going to show you the content of that HTML form so this is a simple form with action register dot PHP hill-hill the method is get in that contain name username and password and there is a button called the sent so I change that one into register okay so save it now we can test our PHP script the filename is registered custard or HTML okay so here I'm going to provide a single user information here the user name is Pradesh now specify the username in the username is provision 1 2 3 specify the password we specify password response 1 1 2 3 and click register and this is the response from server this is a simple JSON object with only one property response and by default the response is ok that means the user registration success so we can check the database and click the Browse button and here is the new user here is the name username and password ok so now the user registration success now I'm going to register the same user again in that case we get an existing asset from the server so here I try to register the same user again in that case this is the response from server the responses exist a particular user already available in database so that now we complete the registration part now we can we need to place a PHP script that perform the new user login sorry user login so now this is tar PHP script for performing user login I copy that PHP script place it inside the server now I can show you the content of the PHP script so here also the same thing first we have to establish a connection to the database now we need to get the username and password from the Android app and here we save the username and password into this variables username and your password and now we need to fetch the information from the table if the user exists we have to send the Android application the usual available otherwise we can send fail so here this ql curry is select a name from login info so we have it to send back a name to the android application to show you a welcome message so here the scale quarry is the name from login info our username is this variable and user password is this now we need to execute the SQL query so here we call the function MySQL like relay and pass the connection and SQL query and if the number of rows the number of rows of result is greater than 0 that means a user already available in that case sorry here the if loop first we put a not symbol that means if it is true that means the status is failed that means user is not available in that case we create a simple JSON array JSON object called the response and value for statuses failed that means login fail otherwise we have it to send back the response and name to the Android application so here we have to fetch the row from the result so create available called a rock and fixed it all from the result and now we need to fetch the name from the result for that here I get the name from the row this is the column name and here I create available status and value for status is okay that means login II success now we perform a JSON encode janjira JSON object has two properties response and name and finally we close the database connection so before going to use this PHP script fit on android app we need to check whether it working fine or not so here I create another HTML form called I will show you the scripts here here it is login test so by using this HTML form we can test the login operation so now I place it inside the server now we can test it so luckily cost login app login test the dot HTML so specify the username so first here I entered on some wrong information the user is now not available and click login so here the response from solver is fail the user is not available so now we have to check the database here only one users are available with the name rubbish username pravesh one two three and password one two three okay so now try to end on some valid data if the username is pravesh one two three and password is password one two three that is correct information and right login so this is the calc information so this is the response from server this is a JSON object with the two property response and name so we have the response is okay that means user login success and this is the name of the user so that we can create a we can show a welcome message in your Android application so this is the server part of our application now we can start with the Android application development open Android studio and create a new Android studio project specify your application name here I named it a slogan up example select empty activity and click finish so here the project is created so first I'm going to specify the needed permission for this application so this is a local application so we have to connect to the internet so this application needs the internet permission this is the only one of one permission needed by this application so now here we are going to use a retrofit for establish connection to the server so we have it to add the need dependency for working with a retrofit so open Clara file open module level graded file so this is the these are the two dependencies for retro fit so here I implement two dependencies autofit and autofit decent converter dependencies okay now sing the project so here one thing here the compiled configuration is deprecated from android studio version 3.0 and devil so instead of compile you have to use implementations okay so now we successfully add retrofit so in this application we need three pages first one is a login page second one is a user registration page and Ted when is a success page so here I am going to use fragments for these pages so here we need to create three separate fragment first one is a login fragment a registration fragment and welcome fragment so here I am going to add the needed fragments so create a blank fragment a nimitta slogan appointment so here the fragment is created now Here I am going to add the need at user interface for the login fragment here I already create the need that user interfaces so this is the user interface for login that contain to edit text email and password here it is not email he keeps the username okay so that contain to really text username and password and this is the login button so if the user is not a registered yet for that here we place a text to be for new user registration so now we can close these files now here I am going to add another fragment create a another fragment specify the fragment Nima's registration fragment there is no need of these factory methods and click finish now here I am going to add the needed user interface for the registration fragment [Applause] okay this is the layout for registration fragment it'll contain to clear attacks name username password and here is a register button okay so now we need to create a fragment from the Welcome page so here I'm going to create the Terra fragment here I named it as welcome fragment so now I'm going to add the needed user interface for the Bell comfort so this is the neighborhood for the welcome fragment okay so the welcome fragment contain a text review that here we are going to display a welcome message for the user using that text view and here we place a logout button okay so these are the components of this application so once the user login successfully there is no need to display the login page again that means we have to save the login status of the user so here I'm going to use in shape preferences for saving the login status of the user for that first thing a hurry to add some string resources open modules folder open strings dot XML I'm going to add some string resources I specify the name as reference file 24 that when is preference file now create an adult string resource difference login status change the value into preference login status now if you here create another string resource once the user successfully login me how to save the username so preference user name now here this component to use of name okay so now we need to create a shared preference and we have to save the login status and if the user successfully login me how to save the username on the shared preferences for that Here I am going to create a separate class I named it as brief config first here create some variables for shared preferences now we need to create a variable for context now here I'm going to create a constructor for this class and the constructor need one parameter it is an object of context first initialize the context variable now from the constructor in self I'm going to initialize the shape references so context don't get shared preferences contacts don't get string although windowed conference file I will specify the operation mode should be small private okay so now I'm going to create separate methods for right logging starters read login status so first create a method for write login status public wait write login status now this method need one parameter it's a boolean value and emitter status so first we have to create an editor for shared preferences [Applause] now we can save the information so any turn load it is a boolean put boolean so context or catch swing the string dog here it is preference login status now pass the boolean value here is status now commit the transaction so this method save the user login status now create another method for read the login status to public she'll the return type of this method is a boolean green login status now simply return shake references dot get boolean context Oh get string out of swing don't reference login status and specify the default to value for the data here I specify the default value as false okay so this Matata read the user login status from these shared preferences so now I'm going to create another method for arrive the username so if the user login success we have it to save the name of the user into the shared preferences for that Here I am going to create another method so public wait write a name and this method need one parameter it is needed okay now we can perform the right operation so editor dog code string conduct code get string out of string dog reference user name and pass the data here it is name now commit the transaction okay so this method write the username into these shape references now I'm going to create another method for a read the username so public here the return type a string array the name perotin share prefer access code get the string on that stoat get string card or string don't click current username and here I specify the default value as a user if the data not found it will return you sir okay so these are the two methods for the write and read name of the use of okay so for here I'm going to add one more method for display messages for this application so here I'm going to create a method called display toast so we can display all the messages using this lock out this meat one parameter occasional search now we will display a toaster from this method displaymessage no display okay so this is the different configuration file in that file we play some methods form right right the login status read the login status write the name of the user read the name of the user and here we place a matter like to display symbol toast okay so here we are going to use our profit for the network operations so now I'm going to specify the files for the retrofit configuration the retrofit needed three things first one is an instance of retrofit second one is an interface that contain all the possible API calls and third one is a model class so now I'm going to first I'm going to create the model class for that we have to check the our PHP script so this is the log in PHP so here the response is a JSON object with one parameter response and here if the login success we have another property called the name so these are the two properties of the JSON object response and the name so first here I'm going to create a model class for the retrofit so right click the package create a new Java class I name it as you serve oh you know I'm going to create two variables private string response now create another variable name okay so for the proper mapping specify this utilize the name you can check it so here this username so we hear this response and the name so just want a response here Disney okay so now we need to create the getter methods for these two variables so now here I'm going to create the getter methods okay so this is the model class for Rocco feed now here I'm going to create a class title return an instance of retrofit so right click the package create a and run Java class called API client in this place first I'm going to create some variables public static final spring baseurl specify the base URL here we are going to test this application on virtual device so this is the default IP used by all Android virtual device for accessing the localhost 10 point zero point two point two and our folder name is login up so this is our folder name login app okay so this is the base URL now create some variables for retrofit initialize that variable with the value null oh here I'm going to create a static method that will return an instance over atrophic so public static and the return type is a prophet get API client so he'll check some condition if our profit equals another in that case we have to initialize that one or a profit equal to mu retrofit predator add the base URL now I had a convertor factory jisun convert the factory dot create and finally called Abel D'Amato now we can return the trophy to object from this method so this is the class third return an instance of retrofit now we need to create an interface that contain possible API cons so here create angle plus internal Java class I named it as API interface so this is not a class it is an interface so here I'm going to specify two abstract methods first one is perform a registration this method for the user registration so here with a return type of this method is an object of call class here the return type is an object of use surplus so this is the first a black marker now specify the second method second method is don't form user login so this is the second matter but also reckoned IEP is the same okay now specify the nd URLs so for registration specify the indy URL so here our enter URL saw login dot PHP and register dot PHP so for registration it is register dot PHP and for login and for login it is login dot PHP okay now specify the parameters for that this is the login form for login we need to parameter user name and user password so these are the JSON properties username and your password now we need to check the registration form so for registration these are the properties name username and user password okay now specify the parameters for so for registration first parameter is name second parameter if you use some name the parameter is user password okay now specify the JSON object properties you use actually Ricky's name and for the username here it is username now specified to Jason property for the user password here is user password okay so now for the poor performing login we need user name and user password okay so perform login we need two parameters username and user password and these are the JSON object properties user password and user name so this is the interface that contains two possible API calls perform registration and perform user login now we can add the fragment to the main activity firstly how to place a fragment container inside the activity main dot XML so here it text to view is available delete that one select layouts here I draw a frame layout into this layout and only the constraints for the frame layout if I create constraints on all sides okay so now I'm going to specify an ID for the frame layout I named it as fragment container so this is the container from the fragment so now we can add fragments to the main activity okay so open main activity file plus file so first thing I'm going to create some variables for reference country now we can initialize that variable reference pump it pass the context okay so now check the condition if fine till you PI D PI D fragment container not equal to null now he'll check the foundation if savor the instance state not equal to null that means the activity resume is state in that case simply return okay so here we have to check some condition if the user already login we have it to display the welcome page otherwise we have it to display the login page so here the check the condition if preference config dot read login status if it will return true that means use of already login in that case we have to display the welcome page otherwise we can display the login page okay so if the user already login we can display the welcome page so get support fragment manager begin transaction don't edit or fragment container and here it is no welcome fragment and committed transaction okay otherwise that means if the user not login yet we can display the login fragment so I copy the same statement so in this case we can display the login fragment okay so before going to do further coding we can test it so here one job multi device is ready we can test it so run the application okay now the application available on this virtual device so here that is the user is not logged in yet that's why is to display the log info so I try to remove that application from the memory and open that application again so here to display the login form okay so now we can perform the new user registration and the user login for that open the login fragment here the key slogan fragment open the layout so for display the user registration registration form the user has to click this text to view so in that case are we having to display the registration form so this is the textview we tied a registrar txt so go to the login fragment here create some object of v+ and I returned that you from here okay so now create some variables for X to view I named it astrology text now initialize that variable oh you don't find the view by ID I'll go tiny don't hear it is our eg register text okay so now create click listener for the variable so ret texture don't set on click listener so now this fragment need to communicate with the activity for that here I'm going to create an interface so public in the face on login form activity listener so here I'm going to define to abstract method public void perform register don't create another method public buiit transform login and for the second method we need one parameter it is name ok so now we have to create a handler for this interface so on login form activity listener looking form activity listener so we can initialize this variable from the on attach method of fragment own attach over like this method so create an object of activity is equal to conduct type cost this one into activity okay so now we can initialize that handler from that method here the variable is login form activity listener so login from activity listen is equal to activity type cost that money into on login from activity listener okay so when user click the text view this method with in växjö from this method we can call that method so before going to do that inside main activity we how to implement that interface on login from activity listener implement our method here you how to implement this to matter perform registry and perform logging okay so now go to login fragment so by using the handler we can call that method perform register now go to main activity so in it inside perform register we can display the registration form so get support fragment manager to begin transaction replace or don't ID dot fragment container fill this new registration fragment and add that one into the back start ready to Baxter and finally commit a transaction okay so when you select the text view it will open the registration form so we can test it so run the application again so here if the user click the registration text review it will open the register form so now we can perform the new user registration so now close all these files now open the registration fragment open the class file and open the layout file so inside the layout here we have a three ad text first one is named with Heidi txt name here is the very text value surname txt username txt password and here is the button with a DB and register now go to the fragment so he'll create some view class object and from this Matata returns at view support on view okay so first here create some variables to private any text name username user password okay so now create some variables for pattern I name it must be an register okay now we can initialize these variables so first one is name so you don't find the view fight ID I'll go eggie txt name now use some name you don't find the view by ID card owed ID dot txt it is txt by username now use that password you taught fine w pi 80 to 90 dot user plus txt I think it is txt password okay now we can initialize the pattern so be able to stop equal to root of 5 3 pi IIT or goat I they don't it is beyond register now create a click listener for the pattern so bien bien registered or set on milk listener or emblem in the callback method here it is on cake so for the use of registration here I'm going to create a separate method public wait perform registration first here create some variables clean name get the name from the depressed now get the username so use the name go get a touch into screen now get the password [Applause] our user password or and get the text in your screen okay now we can perform the user registration so we can check the PHP script in server so this is the registration PHP script so here we have the response like okay error and exist so here the a JSON object has only one property called a response and for the response would be how values like exist okay and error so these are the three conditions we have to handle here so now we can perform the retrofit code so before going to do that go into main activity he'll create some variables public static API interface and in class API interface now initialize available here so API interfaces include API client don't forget API client create API interface dot plus okay now go to registration pikemen so here we can perform the API code so here the return type is an object of cold cloth but contain an object of the user class so main activity don't API interface don't run form a registration so here you need to pass a parameter name user name and user password so first to pass name I username and password okay so now we can get the response from server so call this matter in queue now implement the callback methods so here we have two methods on a response and on failure so now we can handle the response and so here we have 203 condition okay I will check it again so here the conditions are okay error and exist so these are the three conditions so first we can check the success condition so if the response code body both get response dot equals okay that means registration success in that case we can display a message so main activity api preference concrete old call the method are displayed post which is creation success okay now we can check the second condition LC responds don't Cody don't get a response dot equals exists in that case again we can display some message to the user use of already exists now we can check the last condition [Applause] we can took the last condition is error in that case display some message something went wrong okay so after this matter after executing this method we can research all the field so name dot city text into an early user password dot say to text into null and final one is username okay and finally we can call that method performed registration so now we can test our application okay now we can open the localhost we can open the web server and here I use a localhost go to PHP my admin so this is our database so here the database contains some data now I try to delete all the information in database now there is no information in table ok now we can test our application so for Android studio run the project okay now the application available on this virtual device so now we can test it so try to register a new user specify name now specify user name till the user name is pravesh 1-2-3 specify password i specify the password us-british to the past four three two one and try to register so here the information from server is registration success you can check the database and here is the user the user successfully added to the database now I'm going to save this same user again try to register the same user again with the username pravesh one two three specify the same username and specify some password so this users are already available on database try to register so this is the response from server user already exists okay now we can perform the user login operations so close these files we need the main activity file we need the login fragment class file open the login layout which is the login they owed so inside the login form we have a to edit text with ID username and you surpassed this is the button with ID login bein so now go to the logon fragmental Java so here create our needed variables private edit text user name and user password now we need a button private button I named it as a login bein so first we can initialize these variables so first we can initialize the username beautto find the view by ID after i didö our username now we can initialize the user password have you got my interview by ID I'll go tidy user password and now we can initialize that button here the pattern is login be n so log in TN equal to u dot to find the view by ID / tidy here it is login p.m. okay here create a click listener from the pattern so log in B and dot set on click listener okay so here I'm going to create a separate method for performing the user login so private void perform login first we have to create the username and password from the edit text username equal to username don't eat the text in do string now get key password password is equal to user password dot get the text to screen so now we can perform the user login so before going to do that check the log in PHP script so here the response JSON object has two property response and the name the response may be failed and okay so this is the do condition we how to handle and here the JSON IFTA logins access the JSON object has two property response and a name if the login failed there is only one property called the response the value for that one is failed so this is the two conditions so now we can perform the login so give the return type is an object of the user class I mean activity don't API interface don't perform user login here you need to pass the user Liman user password so fast the user name now about the password okay now we can handle the response implement a callback matters so here first we can check the conditions if the login success or not so if a response toad politoed data response dot equals okay the response is okay we can check it yes it is okay and so in that case login success so in that case we can call the mattered in main activity called the perform login for that here we have a handler called the login form activity listener so by using that method login from activity listener we can call them and third platform login and we have to pass the name so we need to get the name from the response so response toward body dot get a name P so at the same time we have to update the login status in shared preferences so main activity load preference config tote write login status in the truth so we are the login success okay so now inside main activity that means if the login success inside main activity we got the username here so first here I am going to write the username to the M reference file shape or France so preference config dope right to name and pass the name now here I am going to call the welcome fragment so get support fragment manager load begin transaction so here it is replace or do I need or barackman container now specify the fragment object here it is welcome fragment new Belkin fragment and commit the transaction ok now go back to login fragment or Java so here we handled the success situation now we have to handle the error situation I'll see response dot body doe get the response don't equals fail that means login fee in that case we can display a toast to the user so main activity dot reference convict dot display toast login fail please try again [Applause] so after executing this method we have it to reset all deforms so here you surname use the name Bach secret exchange annul our user password dot set a text into null okay so now we can call this method from the button on click listener so this is the button on click listener so from this method we can call the motto from logging okay now open the Welcome fragment and the corresponding layout so here we have a textview by using that textview we display a greeting message to the user so here the ID of the textview is a txt name info and here is the logout button with ID be and logout so now go to the Welcome fragment of Java he'll create an object of view class and we call that up top from this method so return view so here we how to play eight two variables private touch to you I named it as text tube you now we have to create a local pattern private button an emitters be n log out okay now we can initialize these two variables text review equal to beautifying the view pie they are load add a dot txt naming form now we can initialize the logout button so be and logo T culture we don't find the view pie IIT our boat ID don't be and logout now create a click listener for the pattern so be and logo top set on click listener implement the callback method here only one method on click ok so first thing if the registration if the user login success we have it to get the name from name of the user from the share preference and we can display it on the text view so text to be dot set text main activity dot preference config don't read name and we can display some greeting message to the user we welcome you sir ok so if the user click the button this fragment need to communicate with the main activity for that here I'm going to create an interface for this fragment so public interface on logout listener and in that method in that interface we need only one method public we'd logout performed ok so now we need to override one lifecycle method for this fragment on attached inside on attach create some variables for context so they'll be how to create some variables for activity committee equal to context typecast this one into activity so now here inside this fragment create a handler for the interface so on logon listener and emitters now good listener so we can initialize that local traditional handler from the own attach matter so logout is not equal to activity now typecast this one into on logout listener so now open main activity so main activity need to implement that interface so here this on logout listener so here we have to implement one method logout performed okay now go to the Welcome fragment so if the user click the logout button we have to call this method we have to call the method in main activity by using the handler of the interface so logout lizard or logout perform ok so now go to main activity so if the user perform the knockout we have to replace the fragment so get support fragment manager so instead of the Welcome fragment here we have to display the login fragment again and commit so at the same time we have to reset the shared preferences so preference config dot right login status into false also we can visit the name write the name into I simply change the name in do simply user ok now we can test our application ok now we run the application ok now the application available on this virtual device so here is our database now there is only one user available now here I am going to add one more user user name is tamas name of the user is Thomas now specify user name into Thomas one two three and now specify password here the password is password three two one and try to register so the registration is successful so we can check the database so here is the new user here is the username and password and now we can try to login the new user so here the username for Thomas is Thomas one two three so specify the username Thomas one two three and here the password is password three two one okay first I try to enter some wrong information so this is a long information right to logging so here the log-in failed now applied to log in with two valid information here it is Thomas one two three now try to know the password is pass four three two one password three two one and click the login button so here the login success and here is the welcome message for this sorry for the spelling mistake so now I remove the application from the memory and try to open the application again so here instead of display the login page again in to display the welcome page now the use of try to knock out so here how the user is logout from the application so if the user opened the same application again it will display it in a login form so now I try to register try to login with another username give these rupees one two three plus one plus four three two one okay try to login so now the second user successfully logging so this is how we create a simple user registration login form in your Android application using retrofit and a web server I hope you understand all these concepts for getting more Android tutorial updates please subscribe this channel thank you for watching see you in the next episode
Info
Channel: PRABEESH R K
Views: 102,615
Rating: 4.7294483 out of 5
Keywords: android login restful web service, android login restul api, rest api, retrofit, mysql database, android, tutorial, android login example, android login with mysql database, Simple Login App, login app, android studio, remote server database
Id: d5jfNSFu45U
Channel Id: undefined
Length: 73min 16sec (4396 seconds)
Published: Mon Mar 05 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.