I want to download image on firebase
storage in android app.
this is my image
I try this but it is not working
storageR
// Create a storage reference from our app
StorageReference storageRef = storage.getReference();
// Or Create a reference to a file from a Google Cloud Storage URI
StorageReference gsReference =
storage.getReferenceFromUrl("gs://bucket/images/stars.jpg");
/*In this case we'll use this kind of reference*/
//Download file in Memory
StorageReference islandRef = storageRef.child("images/island.jpg");
final long ONE_MEGABYTE = 1024 * 1024;
islandRef.getBytes(ONE_MEGABYTE).addOnSuccessListener(new
OnSuccessListener() {
@Override
public void onSuccess(byte[] bytes) {
// Data for "images/island.jpg" is returns, use this as needed
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Handle any errors
}
});