Recover an image in firebase Storage and display in the app using GLIDE

Asked

Viewed 994 times

0

I’m trying to recover an image from Storage of Firebase using the Glide, I searched in many places, I used the code the way I’ve been seeing and yet I couldn’t recover the image at all. Attached shows how I wanted it to look, the first image shows how it should be, these images are in the app itself, then the next image shows how it is getting, I removed the image from the calendar to try to recover by firebase but I could not. It follows below the code and images

public class MainActivity extends AppCompatActivity {
    private ImageView proximaAcao;
    private ImageView galeria;
    private ImageView calendario;
    private ImageView contatos;



@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    proximaAcao = (ImageView) findViewById(R.id.proxima_acao_id);
    galeria = (ImageView) findViewById(R.id.galeria_id);
    calendario = (ImageView) findViewById(R.id.calendario_id);
    contatos = (ImageView) findViewById(R.id.contatos_id);


    Glide.with(MainActivity.this).load("gs://doe-amor.appspot.com/calendario_app.png");

I’ve already put the right dependencies on the grid and nothing, someone could help me?

como deveria ser

como está

2 answers

0

I think you forgot to put the Imageview that you want the image to appear

Glide.with(MainActivity.this).load("gs://doe-amor.appspot.com/calendario_app.png").into(suaImageView);

I hope I’ve helped

0

This is because you are using the incorrect URL. With this URL only you have access to the image.

Go to firebase console, and find the image in Storage and click "Generate Download URL", a URL will be generated to download the image (starting with "https"). Use this URL in Glide and your image will load without any problem.

  • I did it, I created the download link, put it there but it continues the same way! In fact I had already done, I used the two links, both the one I placed and the link to download.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.