How to insert user data into firebase real-time database with Image part 3

 



Welcome back again to this tutorial number three of our android firebase application so if you're just new to this video guys be sure to watch my previous video this is what you have done in the previous video and before we move to the activity uh code be sure to set the input type if it's built so
like you need to assign an input type so I have to set it to the text email address, to the file, you need to set an input type and I set its password as you can see here be sure to uh assign the respected uh type so that we are defined in our layout now let's go to let me just add one for you so because you want to

have a limits you can upload an image for our profile, we can just add images, for now, so now I'll just do this, so it will just move a little bit to the top or image and then I will just create a default image, okay I just use this one to check the image, okay now I need to assign an id profile now
once I have already done that let's move to the activity your name submit we have all these fields  creating the image plus variables so you should name it we are just returning the elements from our layouts by preparing the id of those elements you can get those elements to be sure uh that you have or uh already watched my previous video if you are in case you are just new um with you guys let's go and check our dependency so be sure that you added this to a line of codes or statement we need also to

implement find the firebase database because we will get an instance for these two so now let me just initialize the firebase but uh I'll just declare constant here start it right now stream database and we will put the value for our database our be sure guys that you have already uh watched my previous video before you will uh watch this video because you might be lost just  baby and now what we need to do just need to copy the link reference URL this is the URL or the link location of our database so we need to click ok now, I will initialize the database that bit instance but read it URL okay i will pass okay you can use this one or you can use this one for that child and I will just put it to the user in a let me just initialize the storage because we are going to use this one when we want to upload some file like images so now uh once we already uh initializing this variable what we are going to do now um

I will just use this one with us on how we can add and put an image when you select an image from our devices or your device so I will go here and create a method just inside and profile icon
that's it then  let me just declare another picture private uh start find out in record this request good plus one okay private URI this is a unique resource identifier that we are going to use for our uh image
once we have already done that we can get back to us and then we can pass content content
you can set a type this one type image just now let's go and now okay let's try to run this one and let us see what will happen so this intent will uh get ok so some error here, I'll just create a style and I will
you can define a style and a name I'll just define the formula with this here called the radius size 50.

and I'll just assign it to the uh shape of all images and then we can choose it to make it a circle around it now once you've already done that let's go let me just try to run it into the device so we can see what this intent when we click the icon okay we should try patient guys because uh this video might get a little bit long so if you're interested to watch the tutorial uh about fire-first and you can just stick within this video guys so okay so now I will pick the device so you just hit the device as you can see it is a little bit run but when I click as you can see, this uh get the image in our android phone so this uh this is uh this the intent uh action get content doing whenever we click the image and by sitting as an image folder we can screen with the new intent to get the content inside of our phone so there is the reason

 why you can access the image so now if you click this one the image is not setting an icon because we did not need to call our URI so this will not work but we can override a method on activity result and here we can uh check if and check if the request code is equal to the request code that we have defined and we can also check if the result code is equal to the result okay it does we can execute a statement or a body here you can write it will be executed so you can say image URI you can see star Uri or the uh resource identifier here to data that get data and you can set it to our profile icon to go back to the image URI you need resource within the file so now if you run this one you should assign an image to our profile icon in the image, okay so that is just waiting uh where did this

 installing my phone we are going to learn how we can image information into our list so now I will try to go, emulator, i will just click and then I will choose an image for example so as you can see it is us sign or stick into the image but we cannot submit it because right ready didn't write a code to submit this one into the real-time database or to the storage uh database before uh I will just uh start the video I will just want to let you know that in order to eat it or to read and write data to our uh real-time database we need to change the value of this two key value first to also into our storage so to make a change into our uh storage repairs so we need to go to the rules uh make sure that we set it to clear otherwise

read and write stories uh real-time so that is for today's English this video guys so I hope you follow my next video be sure to follow my distance because we will be uh doing some amazing uh things in this video like you can upload an image to our database later on you will just fix that back to our application UI so guys thanks for learning something in this video please be sure to subscribe if you have uh so many bugs

In this video, we are going to learn how we can insert user data into Firebase Realtime plus we will also add a function that will allow users to upload an image to Firebase Storage, so we will have a better understanding here of how we can Integrate it to our android app. Get up to date with the latest video upload by turning on the notification bell icon from this channel.

#Root build. Gradle code:


#App build. Gradle code:



#Manifest.xml code:



#MainActivity code:



#Model  Class Code:



#Pager Adapter Class Code:


#PageViewer Activity Class Code:



Download Complete zip file: #Mirror1,#Mirror2

Post a Comment

0 Comments