Android Firebase Tutorial

Android Upload and Retrieve Images in Firebase Storage/ Firebase Database Part One

In this Android Upload Image using Firebase Storage tutorial, I am going to show you how you can upload image in Firebase storage, save information in Firebase database and retrieve the information from FirebaseDatabase, show it using Cardview and Recyclerview.

In this tutorial I am using firebase storage to store images and save the information in Firebase Database. Then in the image gallery we will use Recyclerview and cardview to show uploaded images. In this part I am using addOnSuccessListener method to get the downloadurl. After updating the firebase you may have fetched the problem getDownloadUrl() is depricated, here I have shown you an alternative way to getDownloadUrl(). I hope you enjoy this tutorial and don’t forget to share and subscribe. See soon in the next episode with more exciting features.

You can find the video tutorial in my youtube channel:

Android Upload Image using Firebase Storage

Lets start adding the supporting library file in build.gradle file:

 

So, now add the INTERNET permission and READ_EXTERNAL_STORAGE permission in AndroidManifest.xml file:

 

In the main activity file we are going to add option to select image and description with progressbar so check the xml layout file for the activity_main.xml:

Now lets write the java code to manage all of the upload functions. First we need upload model :

Now lets manage the MainActivity.java:

So we have complete the first part here which help to upload image in firestorage and save information in firebase database.

You can download the project source code at my github account: https://github.com/jdulal/AndroidUploadRetrieveimagesusingFirebaseStorage

Related Post