Hello everyone welcome back to this firebase tutorial this is tutorial number four of our uh android demo tutorial so here we are uh going to upload an image to our storage or firebase storage so we can in the bb speaker we are just setting this icon to the elements in our UI, but before we will do that I'll just
read and write into our storage we need to see the value need to set the value, in the rules tab so we need to make sure that we set it up correctly so that you change it to true by default it will be pulse but you need to change it to true and then you will just save it the same also in our real-time database, uh
you need to set the value to true otherwise it will not allow you to read the data okay so just for the testing purposes so I will just be going to scroll down okay I'll just go here okay so I'll just go here in the start let's see the image URI so this is what we have done in the previous video so now then we can
actually submit the image into the get reference okay you can reference the storage okay uh child you can write and you can add another child and we can just pass the image URI here to get the last part signal okay okay already done that we are just doing an instance and getting the reference uh into our privacy students then we are telling that we are given to the child, so we are adding a child with the name image and then inside of that image then we are just the last part segment of the URI or this
identifier after that the storage reference the file and then you can just image URI that adds okay and successfully now you type upload tasks, okay here if the upload task is successful we can URI type download URL plus Snapchat storage you can even uh immediately write the user reference your image
image icon be sure if we can successfully upload okay submit the image so now let's do it here I'm going to submit okay hopefully the next one is crossing letters okay, you can actually remove this one but as you can see here you can still submit it so the image should be here and you can still see the image is we get an error so we can add a listener here one complete listener so new one completed
you can check if the stream is okay so we can fold in frequency that's its value actually and you can set the value okay so this will writing on success will be successful we are creating a download URL here
and adding uh one complete listener so we will check the task if it is successful we need to get the result of that task add it to the image and declare another here so yeah I'll declare a progress dialog here just to show the dialog okay you can see uploading and dialogue, let's try to run the application and we can also set the image we need to find iPhone that's it now just start the installation process so okay I'll just choose to submit login is okay guys now inside the image folder, we see the image after two already attempted to be switched okay so as you can see here so uh this is uh done by uh this is the string and then the unique resource identifier
will hit the result and convert it into a string then we put it into the image child the body will be displayed I hope you learned something from this video and if you do so please consider subscribing if you have some questions please write in the comment box I'll see you in the next video guys so please be sure to follow this video so thanks for watching guys I hope to see you in the next video
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.
0 Comments