Upload file on Firebase Storage in Android

Firebase provides lot of good feature as we had seen in my last tutorial. If you have not seen my last articles Here is the quick description Firebase Database and authentication and Firebase Analytics.Today I am sharing article to upload any files on Firebase storage. Lets talk about what is firebase storage. Firebase Storage is built for app developers who need to store and serve user-generated content, such as photos or videos. Firebase Storage is a stand-alone solution for uploading user generated content like images and videos from an iOS and Android device, as well as the Web.Here is firebase storage video by Firebase Team.

Lets start configuration for firebase storage and database. Here is video that helps you understand before start upload.

Step.1: Please go to Firebase console to create the project.

Step.2: Now you can create the project name and enter your county name.

Step.3: You have to choose which platform do you want to use. Here we are configuring for android platform, so I am choosing option for android app.

Step.4: Now you need to enter your package name of your project. Ex: Here my package name is "com.sunil.firebasedatabasetest" . Other fields are optional for debug mode. But if you want to release your app that time you need to pass the SHA-1 key.

Step.5: Once you done your step.4 You will get downloded one google-services.json file. You have to copy this file and paste inside the app folder.

I will get the file form gallery and upload on Firebase storage. Before upload user should be authenticate to give reference where he wants to upload. Here I have button for select picture from gallery and one more button to upload on firebase storage.