Android Upload Image with Text to Firebase Storage Tutorial

How to select image from mobile phone’s storage or gallery and upload to online Firebase storage along with Image Name text and store image name into Firebase real time database.

Firebase gives us 5 GB of free space to upload Image, PDF, DOC etc files with 1 GB/Day downloading limit. This is good for starter android apps. You can use Firebase Storage to upload and store your app’s images and also to upload your personal files.

So in this tutorial we would going Create an android application which would upload the selected image from phone’s storage to online Firebase Storage and store image URL with image name into Firebase real time database with unique ID, So they can be access again via JSon format.

10. Here you go now your google-services.json file has been successfully generated. Hit the Download google-services.json button to download this file physically into your computer.

11. Next step is to add google-services.json inside your project. So open your project and put( Copy ) google-services.json file inside YourProjectName/app folder. For example my firebase project name is Firebase-AndroidJSon.com then my app folder located is Firebase-AndroidJSon.com/app . Now copy the google-services.json file into app folder like i did in below screenshot.

Using onActivityResult() method android developer can get any data back from opened application. So we get the selected image using this method and set selected image into ImageView. After that we would store the image path into URI.