Retrieve Image from Firebase Storage in Android

In this Tutorial, we will learn how to retrieve image from firebase storage in Android Studio.  We have already shown you how to do Google Firebase authentication you can check the Firebase Tutorial. So lets start this Firebase Storage.


Firebase is a mobile and web application development platform developed by Firebase, Inc. in 2011, then acquired by Google in 2014. As of October 2018, the Firebase platform has 18 products, which are used by 1.5 million apps. It helps us to quickly develop high-quality apps, grow our user base, and earn more money.


Glide is an Image Loader Library for Android developed by bump tech and is a library that is recommended by Google. It has been used in many Google open source projects including Google I/O 2014 official application. Glide supports fetching, decoding, and displaying video stills, images, and animated GIFs.


1. Open

2. Click on “Get Started project”.

3. Click on “Add Project”.

4. Add Project Name of your choice.

Firebase Image Create

5. Click on the “Create Project” Button at the bottom.

6. Click on Android symbol.


7. You will see a page titled “Add Firebase to your Android app”

Image from Firebase 1

8. Add your Android package name.

For example  ->   com.example.retrieving_images_from_firebase;

9. Add SHA1 key and click on “Register App”.

10. Click on “Download google-services.json” button to download this file.

11. Then, add google-services.json inside your project/app folder.

Retrieve Image 3

12. Open your Project’s gradle(Project)file. Add this dependency inside dependencies block.

classpath ""

Below is a screenshot of the same:-

Android Dependencies Retrieve Image 4

13. Open your project’s gradle(Module:app)file. Add dependencies:-

androidTestImplementation ''
androidTestImplementation ''
implementation 'com.squareup.picasso:picasso:2.71828'
testImplementation 'junit:junit:4.12'
implementation 'com.github.bumptech.glide:glide:4.7.1'
compile ''
compile '' 
compile '' 
compile '' 
compile 'com.firebaseui:firebase-ui-database:2.1.0' 

Below is a screenshot of the same:-

dependencies Retrieve Image 5

14. Now finally add below packagingOptions just bottom of buildTypes block.

packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'

Below is a screenshot of the same:-

Retrieve Image 6

15. Open, Select your project.

Now click on Database -> Rules. Add the following lines:

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write;

Click on Storage -> Rules. Add the following lines:

service {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write: if request.auth != null;

16. Now Click on Storage->Files. Upload an image using the “Upload file” button.

Firebase storage Retrieve Image 7

17. Click on any uploaded image. Then on the right-hand side, at the bottom, you will find Download URL1. Copy that location.

firebase Retrieve Image 8


Create an Imageview to retrieve an image of a given URL.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=""

        android:text="RETRIEVE FROM FIREBASE"



package com.example.retrieving_images_from_firebase;

import android.os.Bundle;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

public class MainActivity extends AppCompatActivity {

    ImageView imageView;
    protected void onCreate(Bundle savedInstanceState) {


        String url="";//Retrieved url as mentioned above



Congratulations!! Now, You are in a position to run your application.

After running your application, you will find your retrieved image.

Image from Firebase

You can access code through our GitHub link also:-


This was a simple tutorial based on Firebase Storage Image Retrieval. Comment down below for any query.

Stay tuned for more such Android articles!!!!!!!

Hot Topics

JSON Parsing in Android Tutorial

In this article, we will learn, how to do JSON Parsing in Android. JSON stands for JavaScript Object Notation. It is a lightweight format...

How to get Partner Title in PUBG Mobile in 5 minutes?

This is the new title that PUBG Mobile has introduced in October 2019 update. The title name is "Partner". What is Partner Title in PUBG Mobile? This...

Google Login And Registration For Android Using Firebase Authentication

In this tutorial, we will learn how to build simple google login and registration for android using Firebase Authentication. We have added Email &...

Related Articles

Use of “Services.dart” Package in the Flutter

We often come at a point where we need some flexibility, in our app UI. so in this blog, I want to share two...

Navigating Through Screens with Named Routes

An app is nothing but just lots of beautiful screens with different functionalities connected together for great and easy user experience. Let us dive...

Social Media Buttons in Flutter Web

Social media buttons on websites are not a new thing. We all are familiar with them somehow. We can find it on every website...