Obsolete
Status Update
Comments
jo...@google.com <jo...@google.com>
sa...@google.com <sa...@google.com> #2
Thank you for your feedback. We assure you that we are doing our best to address the issue reported, however our product team has shifted work priority that doesn't include this issue. For now, we will be closing the issue as won't fix obsolete. If this issue currently still exists, we request that you log a new issue along with latest bug report here https://goo.gl/TbMiIO .
Description
Greetings !!!
I was exploring the great platform of Firebase. In your Firebase Storage documentation I came across an issue with code snippet.
In Upload Files Section, division operation inside onProgress() is performed on both long parameters.
taskSnapshot.getBytesTransferred() and taskSnapshot.getTotalByteCount() both return long.
and division operation of two long numbers will always result in 0 (Zero)
So, finally you will get 0.0 every time onProgress() is called, unless whole file is not uploaded and division operation returns 1.
Url to code snippet:
Text containing error:
// Observe state change events such as progress, pause, and resume
uploadTask.addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {
@Override
public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {
double progress = 100.0 * (taskSnapshot.getBytesTransferred() / taskSnapshot.getTotalByteCount());
System.out.println("Upload is " + progress + "% done");
}
}).addOnPausedListener(new OnPausedListener<UploadTask.TaskSnapshot>() {
@Override
public void onPaused(UploadTask.TaskSnapshot taskSnapshot) {
System.out.println("Upload is paused");
}
});
Please correct it.
Thanks.