I upload an image to Firebase Storage for profil_image
,
with this code
StorageReference reference = storageReference.child("Profil_photo/"+ UUID.randomUUID().toString());
reference.putBytes(dataarray).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
progressDialog.dismiss();
Toast.makeText(Register.this,"gambar berhasil di upload",Toast.LENGTH_SHORT).show();
}
}).addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {
@Override
public void onProgress(@NonNull UploadTask.TaskSnapshot snapshot) {
double progress = (100.0*snapshot.getBytesTransferred()/snapshot.getTotalByteCount());
progressDialog.setMessage("Proses Upload "+(int)progress + "%");
}
});
}
I am still a newbie, how to retrieve images that I can use in my home menu
I has try to use Uri downloadURL = tasksnapshot.getDownloadURL
but i can't found getDownloadurl