Android Login/Registration by Firebase Email Authentication, Realtime Database and Firebase Storage

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everybody welcome to a new tutorial this tutorial we will learn how to create Logan and the registration system using fire piece email and password assume education and real time database has shown an example here on user click on register button and there seem to registration activity and type his name and email address and the tech register a registration is successfully at their center rubin activity and he can now log into his account one user has successfully logged in his account he can change the password by adding old password and heading new password and he can now change the password and he can lumen hanyan success fee and also he can change his profile image and his trail learns you how to reduce image size to read to see of the spaces on real-time storage where the image has a pretty successfully he can upload another image all images will be added to his account and he can use all the images also as his profile image ok the user can look out and can send forged email address for the password now an email sent to reset password how in he motto is email address and he will receive free the bug is a password for the open three station project and clicks a link now he can change the password again okay now password has changed successfully and the horn he returned to global activity and try to the new password now no one has successful by is a new password please don't forget to Like and subscribe and let's start a new Android study project I have started doing on the rotisserie project was named fireplace token and registration first of soon we need to set up the brother file this is required to bend dances for first design as a project we need to design dependency and materiality takest certainly image view light and recycler view for Gradle project code 11 no chances required sync now ok synchronisation success freedom second step is Android manifest file we need to add permission to use Internet second step is setting the color and style the primary color is orange color and color primary is white and also on our accent is right for Styles we need to add style I have added new style with name - tile and Beyond seemed upon that light and background-color:white next step we need to create to trouble file files for border we need to create white border and we need to also need to create orange border go to draw and create new drop the source file and limit white border okay we need to delete selector and add layer list inside layer list we need to add item inside I think we need to add shape with property shape rectangle inside shape we need to add two properties window add solid this color color primary is white and we need to add corners twist radius 15 DB okey our ship is ready you can copy this white Porter XML file and paste it again and trouble and animate orange word on next step we need to set up our activities we need to start with main activity and go to XML while from inactivity deletes a textview I'll change constraint layout to relative layout and add background color primary dark inside relativelayout create linear layout match parent and drop content for rate and orientation vertical and layout central vertical is true because we need to the linear layout to adjusted in the center of screen inside linear layout add text view and limit Logan and change the color to primary and the size 50 VP vault and margin top is 10 DB under the test view we need to create frame layout frame layout will take the background as white border and elevation 10 DB and outline ambient shadow color is color clear 3 inside it we need to add material edit the cast the material editor guests with a out head match parent because that parent hit his 16 speci ji-tae and margin of parent frame layout is 20 DB so the material at the ethicist has made floating ripple normal and and email address because it for email and with padding 60 DB and made pistol our primary dark background 10th primary dark and text color and primary dark this is attributes required we need to copy this frame layout change it to password and for hand password okay okay under password but really that the guest we need to add progress bar and we get visibility gone because we need to add Logan button the look important required to P and frame parent layout the parent layout with background white border and the background of the pot is selectable item background to mix up button is selectable our or clickable we need to copy this button and best it here and change it to register and change I need to register with the same attributes next step we need to add text view for 4k 4k password the affirm the password text view with attribute text color color primary and link clickable true next up we'll need to create register activity register activity XML file requires bar layout file looks like that so we need to create new layout side named it bar layout we need to add toolbar the toolbar with attributes orientation vertical maybe not require and match parent for layout plates and drop content for layout hit and background color primary target a bit color orange and texture color is color primary to hit color of the text our title as white and styled basis in overlay up combat activity up combat dark action bar and pop-up seem as - file with ID toolbar we need to include this toolbar but first we'll change the constraint layout to relatively out and we need to include i D a tidy toolbar and the out the out partly out because we need to create linear layout under bar layout and with attribute layout below ie to port to make it under the toolbar inside linear layout we need to add the registration data we need to add widgets for registration data we need to add text view to show the activity type and and material text edit text we copied from relativity same file so we need to get this frame layout and copy change the hand to user name and ID to user name and on for email and one for password and with help us world and one for mobile and minute ID Ohio with input type text Natick and the input type for password biggest password and we need to change and boot type for user name to the guest person named after that we need to add radio button group with a radio button group with background orange border and orientation vertical and the out hate rap content and with ID radio button and saturate the between group we need to add two radio buttons for agender the first 1/4 mil and with text color color primary and bottom paint color primary copies ready Putin and tested and in Ahmet female and with text female next step we need to do Chris mark the progress bar with color primary dark and visibility look at gun next we need to add restriction pot we need to combat some main activity what would you gesture pot and copy this frame layout to this pot so we need to change the color of frame route to orange border and change the text color to color primary and with background to selectable pack item background okay our research entity is ready now next step we need to add our project to to fire piece this step we will start with tools and open fire base as system if fireplace assistant doesn't installed in your Android studio open file and settings and go to plugins inside bug logins search for fire piece okay it's fire piece service already installed after installing it an understudy will resort open tools and select fire piece assessment first following to add identification to the project email and password design kitchen first step connect to firebase this step will direct you to the browser and opens fire base log into fireplace use with your developer account and once you add your project and click continue not require Google Analytics and click create project okay now click continue and click connect to firebase to Android app okay the project is conducted successfully okay and the project here connect okay second step is adding firebase authentication to your app and click on this book this automatically adds a required dependences and reset that project and click accept changes it already adds the fireplace turbine 10,000 edition okay done successfully now we need to go to firebase and go to console we note that these are project created here click is a name bottle also medication click on it and click set sign up missile and go to email and password and edit add enable with two buttons and click Save now go to database and go to the section of real-time database and create kill it create database and start in test mode okay now we have one year your security rules are defined as public so anyone can steal to buy or delete data and you that is go to rules now we need to change these rules first thing we need to add rules for users table under users reference or table we need to add variable user ID and the here we need to add read and write rules here we need to add another condition and user ie handles a medication not equal equal to null okay so the user cannot read to the database if he is not also mitigated and the user ID is identified our or is the same as authentication dot user our unified ID now we need to publish but before it we need to add another rules for lid and add for it and click publish and return to database we need we note that the warning has removed okay next step go to storage and we need to get started to storage click Next and select the server location okay we need to create new folder and limit profile images and click add folder and this folder we will add the provide images okay now but we run droid studio after that we need to return to assistant and we need to add real-time database manipulate 7-3 virata and add real-time database view app accept changes and return to assistant and go to storage and upload and download to cloud and add cloud storage to your app so for now our product is ready for firebase Logan hunt registration now go to register activity and start to find material edit text and the bottoms and register activity and the Booker's bar first we need to set the foot bar in the register activity now we define new tool bar and it's fine find you by ID and set support action bar by tool bar and its title and tool bar dot signification onclicklistener to return to the main activity next step we need to find these widgets by ID then we need to add click result or just our pudding hone user will click on register button when you told he finds the strength of username email password new pile and we need to get the selected gender and check the syllabus gender is not null and ethanol we need to create toast to remind the user to select gender then here we need to add the final string gender for Santa Fe's gender to get the guest and it check is a all weighted text not empty yet not empty then we need to pull the register method in fact register activity is a registration process requires to create an instance of firebase authentication and name it fire this identification and create new instance for this user medication the call to fire please application to get instance and we need to to initialize progress bar and then to create new user by wire piece of the medication and select option was create user with email and password and first parameter is email text and second parameter is password the guest and at home completely long new uncomplete listener if tasks successful here going to save the user data to the firebase database we will do that by defining the firebase user we need to create an instance of fire piece user which is that user is equal to firebase authentication to get current user we need to get user ID strength is equal to fire pieces of to get user ID then we need to create database reference instance and into divine database reference is equal to firebase database put it in a stance with petrol France siren in here should be the same as reference name is in database we need to copy it from database and copy the reference name here users and pasted here taught child this child is the created user ID strength only need to the civil user data the user name email post mail sorry text while gender we need to create my hash map type strength strength hash map is equal to new hash map and put the user data to hash map here we need to make sure the name Z because the key value of hash map will be the child name of the reference it cannot be changed after that make sure the name say we need to make user ID ID user ID you need to copy this line and let's dead here one for username and with value username and long for for email and value email and one for gender and its value you gender and one for mobile and its value for no pion another you need to another hash map for profile image or image URL and with TT value default and add this hash map to database reference by using database reference pot set value and we need to cast hash map dot add-on complete listener new concrete prisoner f tusk is successful we need to start as a Logan activity also we need him to stop progress bar and we need to add required KitKat and we need to assert user ID not a condom and there's a task of creating email and username is not successful else we will need to stop progress bar and create toast we took it task exception and it requires we hope not okay our registration activity is ready to register new user now we need to set up our lumen activity open main activity and online activity XML file now it's everything is ready to good now we need to now we need to find our widgets for email and possible progress bar and textview for re password and we need to find the registration button and Rogin code and we'd find the email password on the progress bar ok now we need to set click restore register button to start register activity and set on click listener for log input is our own click listener of log important we need to divine strength of email text and the password text and if the email and the password is empty we need to toast all Feltes is required else we need to create global method inside Logan method we need to create firebase author education and initialize it and fight mean activity okay inside Logan method we need first to initialize progress bar and then we need to get authentication with sign in with email and password here we took a stochastic for email and the guest for password put Adam completes our own you own complete ass nerve and if task successful and else into toast and if task is successful we need to go to start activity by initializing new intent else we need to toast tasks exception so we need to create muscle to read activity for start activity after Logan we need to stop progress bar to start activity XML file and change constraint layout to linear layout with orientation vertical we need to add profile bar layout so we need to copy this body out here and the B state and layout publisher that in layout file sorry to change the name we need to change it to profile barley out okay inside profile barley out we need to make changes need to add relative layout inside relative our layout we need to add circle image view and we need to add text view for user name now go to start activity XML file and includes a profile bar layout then add Cardiff you much parent for day ahead and do it and the corner radius by 50 DB and margin bottom boy - 50 DB to show the corner here we need to change the background for the activity - color primary dark it is layout here now go to start the activity Java file we need to create text every user name and circle image view and then into the toolbar for AB start activity then we need to find username and self-image room right fire this awesome medication and private database reference and we need to instantiate the fire piece also medication and initialize fire piece user and initialize database reference sequel to firebase that appears to get in a sunspot with reference the reference name is users not child is firepits user to get unified ID then we need to get snapshot for data bits reference to add value even additional sorry add very moving let's not you value move it listen or they are value even tell it's not returns thatís not sure that a statute requires model file to get that we need to create new model files in Java file and in Amit user data aside that we need to create private strength user so user ID and we need to make sure it the same as the data is from the register activity over the real star activity and the best this name and we need to create two constructors the first for all variables and second is MBT constructor and we need to generate getters and setters for all the table is OK now here need to add that value for users data is equal to data snapshot put get volume users that applause so we can set the username text view by user data of both by UA username of the user data as fulling we near have set the cast of user data token username I'm doing we can set the image of this devote we need to say this as ice even sharper ground else we need to use light to load the image to explain image view here in database roof need to toast and cost data be 0 don't get message okay now we need to try our app okay we know here to remove the action bar here we need to open styles you need to change it to no action bar and try it again let's try it okay I have error here we need to open top tab and we need to get the error and we have arrow and register activity we need to include layout but I have added Android layout here let's try that again okay register up 50s already let's try to add new user we need to set that text color escolar primary daughter sorry I only need to add user name not Eamonn and we go click register okay need to add okay it works and is a name of username Epirus and we need to look at firebase database we will that users reference added and unified ID and the user data added here the next step is image upload now we need to enable the user to click the circle image view and it will choose his profile image and upload it to real-time storage and database let's start once a user click on the circle image view is a layout appears here with recycler view with great layout manager and button to open the image from device we achieve that in start activity quite adding click decimal to circle image view now we need to create two layout files the first file for select the image that contains recycler view and the bottom find Trainyard way out with orientation vertical need to add recyclerview match parent and wrap content and ID recyclerview and we need to copy the register button and change the name to open images and each ie open images and change layout a to wrap content and we need to change margin cut to 20 dB the second layer is floor single image rule the row layout is relative layout contains karthik view and the right way out has with 100 TB and hate 100 TB and margin 5 DB and the cardi view has color car color primary dark and easily out version of circle image view 3 DB and with profile image ID now we need to set on crack lesson or initiate in alert the filter we need to change to start activity to this okay okay you know I try to close on red Serge and open it again okay okay now we need to set layout manager for recyclerview as great layout manager with spank on Steve and said has exercised to that we need to create recycler view adapter for selected images this is a view holder class for recycler view adapter and we need to cast it to recyclerview adapter and generate missiles here we need to create model file for list of image URLs and return to recyclerview doctor and create lists private best imageless image list I'm going to create context I'm general constructor and said phew holder and an unborn see all the result we need to set the image using millet and set the image before which images and we need to at least not this listener of circular image view we'll set the image or previously added images for the user who's a user wants to use settings that provide images of previously added images in it just to click to the image and it will update the user image profile to the new selected image make it final and don't forget to set the item count to the image lesson size center return to the start activity and need to initialize recycler adapter now we need to create new image list sorry I have created images but I need list of image list also we need to initialize this image list and uncreate activity next up we need to create collect the images message collected images all damages missiles takes database referral source profile info images and an add-on welcome event listener we need to clear the image list and loop through the data snapshot to get each image rest URL and I to image list array on that snapshot error we produced their error next we need to choose a nerve dialogue we need to define the open image button whose select image layout and when user clicks a button the method of open image work called on we need to create it and start activity then we need to show the alert dialog the open images mossad it causes an activity of the images and here we need to create private static variable for image requests and we need to create on activity result Mossad is that on activity result method we need to check the measure quest and could request is result okay and data not null and null here we need to also check the storage task is completed on completed we need to define new storage tasks and check it if it is not done so we can upload the image and also we need to create the image URI is that comes from data so need to define private URI image URI and defiant is equal to data but get that now we need to create upload image method and this step is important first step create brokers dialog then we need to check if the image Roy URI is not equal not in this case we need to initialize your bitmap and we need to find the media's okay here we need to add try/catch next step need to create by it output array next step is to compress image sorry need to adapt inside the if statement need to assert bitmap not not Coleman next we need to create byte array of image the key step to create storage reference so we need to define storage reference here and initialize it in the activity and the new of cellphones need to copy it from the storage database here we need to set image your name by the user name and current time of the system will really because we need to each image the users uploaded with unique URI so we need to make the users data to general variable okay and we need to create storage tasks and we to create storage task to with continuation tasks continuous tasks this error will appear click alt enter and replace lambda with an image class here you need to add on complete slow and we need to change the type out or to cast type of task to URL and and casted as your I dot add on failure is not so this missile how only the storage task is completed we need to save the image you or I do real-time data piece to sense the current image profile here F dusk is successful we need to define the URI for the safety images that come from the task and we need to convert the WTO riedel to drink and create hash map equals we need to update the reference of the user that image you are I will set it to the created URI so the database reference after update we need to create new reference for profile images so we need to create more images for the single user so we need to create a new reference was child with firebase user with unified ID and here you need to create push method not updated it push Mossad because every time the user select new images new image the new reference or new child will be added to the this is a profile reference and on failure listener we need to dismiss progress bar and toast to the arrow so let's a try our project okay the slogan okay let's a try to click on the circle image view okay we have toast for permission denied because we need to set permissions of real-time database for user and phone open real-time database open rules and cabooses users rules and paste it here and it changes the user rules to the new reference sorry that this performs yes it is okay here no toasts for permission like a Pierce I came on user clicks and open images so we need to read downloads okay at work a successfully but there is some error errors that make the circle image view doesn't appear we will show it okay to solve the error go to register activity and change it to you RL small and user data change it to you are L small and start activity change it to URLs L small and in recycler adapter change it to you are small go to real-time database and delete the profile images try run zap then go to fire piece again and choose the value unless URL to default and the co2 storage and the digital images and open a little and click on open images ok we need to select another image ok torque is perfect okay next step we need to set for the password we need to create a new activity and limit for passport activity now go to XML file for for good passport activity and change personnel to relatively out and include parallel and add linear layout and create text view and limit reset password and open layout first I'll open register XML file and copy the text of email address create the frame layout and the state here also 2 copies are Regis and we change its name and change the gist of register to send message or some preset message please Rory I committed wrong and change ID to send message and progress or above is a bottom and we get visibility gun finally we need to add text view below that button and change its color primary dark and change version 23 now our XML file is ready now in forgive password activity three variables for fire please also medication and progress bar and take a seat view versed state and create code full toolbar and change money and change the title to reset password and torpor medication onclicklistener used to run the two main activity next to me to define with a material edit text and bottom on progress bar and instantiate fireplace all the medication instance and we need to add unprofessional for preset password autumn this process takes two steps first we need to make progress bar visible and next we need to fetch sign is sign in missile forces email because we check as the email is already registered or not and if task good result could sign in missile dot s enmity we need to stop progress bar and we need to set the reset state text view to this message is this is not a registered email you can create new account else that means that is a email address already registered and here we can send password reset reset password email and on task complete task is successful we need to make progress bar is political and we need to set is that thickest of you text tools is thickest hils we need to set the curse of the curse of you boys the exception okay let's try it okay let's rise a free pass for hit activity we need to kick in for bit password thickest okay I forget to add onclicklistener in main activity - in vine forget password let's try to get now we need to set the Ruby password now we need to add the email address and we need to send message okay now we need to open browser and open is a meal the meal has been received for a sitting posture and own user click on the link he can proceed password okay and now we need to try to use the old password to log in and from the password we need to change it to the new password ok it's our start activity now we need to make changes for main activity XML file and the edit text password we need to change that text and put type 2 password the last part is to set the option menu items for Change Password and look out we will do that by creating menu layout file click on resource folder and right-click and click new Android resource directory and set value to menu and click OK and on new folder create new source in your source file and name it the profile menu click okay now we need to add items in the menu I had two items in the first item for Change Password and second item for logout then we need to create new activity for Change Password activity and took finish okay now we need to copy the reactivity password sorry into combination file to copy this edit takest and open change password activity real file change to relatively out and saturated health we need to include the barley out and then need to copy the linearlayout and cabeza password I did the cast so we need to create sleepovers [Music] the first one for old password second one for new password [Music] it's a search one to confirm password [Music] [Music] finally we need to add button to reset or change password okay now and start activity you need to override two missiles the first message is on option menu in create option menu sorry no and this message you need to create an activity itself and boolean method an option item selected inside on create option menu we need to remove this time and relate menu layout [Music] and thus the menu and then return true and also not item we need to get idea of item and check F ID is equal to our locked ID dot we need to return to menu layout file to copy the ID of this menu item else [Music] if ye equal to our tidy not no Gallup ID and return true in this case we need to start activity of Change Password [Music] [Music] and in case of knockout we need to sign out the user here we are to sign out and start mean activity and finish it's a girl now an observed activity sorry change passport activity we need to set the code to change password okay we need to create material edit text for old new and confirm password and button to change password and firebase user and our progress bar and where is authentication and said toolbar for activity and con we need to create in verb this authentication instance and where this user and find few for all new confirm password we need to add click this not to change password button here we need to change password to change password we need first to valid it's a three headed thickest for all new and confirm password so we need to check as a three the thickest is empty or not and checks aliens of the new password and finally confirmed that the confirm password is equal to the new password if everything is right here you need to call the change password method in activity exchange password will be done in two steps the first step is to check the password the old password is the right password by authentication credential we need to create authentication credential and equal to email authorized provider the credential boy fire peace user with that we created in the oncreate activity Mossad to get the email the current fire this user and the old password here is a reason to keep credential returns the success that us successful in this case we need to we can change the password and opted add a password requires firebase user dot update password using text new password and just ask is successful here we need to sign out the user and start with a main activity or blogging activity to Logan again else we need to create toast to show the error message and as a credential deserves credential error or so they're supposed to show the error message okay let's try our app but first we need to check the start activity okay prism represent install okay let's slow him here we can see the option menu item created we can look out the user and Logan again and can change the password by adding their own password and creating new password [Music] can change Prasad okay without all the passport with a new passport result password is wrong I can change it again it's true okay well - password is wrong yes the old password is right from one plate now we change it to 1 to 9 it's Logan again [Music] successfully now we have for Ruben and registration system using email and password firebases on education thank you please don't forget to Like share and subscribe to my channel do it new videos thank you again
Info
Channel: Android Hands
Views: 14,634
Rating: undefined out of 5
Keywords: Login and Registration android studio, login, registration, android registration usinh mysql database, android login using mysql database, how to create protected login and registration system, registration layout android studio, android login registration with Firebase authentication, android login registration by firebase email authentication, android studio firebase realtime database
Id: BHT8hCtOP1U
Channel Id: undefined
Length: 100min 31sec (6031 seconds)
Published: Sun May 10 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.