-1
ダウンロードしたファイルの割合を取得できますか? firebase.google.comに関連するものは見つかりませんでした。Firebase Storageからダウンロード中のパーセンテージダウンロードを取得する方法は?
ダウンロードしたファイルの割合を取得できますか? firebase.google.comに関連するものは見つかりませんでした。Firebase Storageからダウンロード中のパーセンテージダウンロードを取得する方法は?
これを使用してください。
public void onProgress(FileDownloadTask.Task task) {
double fprogress = (100.0 * task.getBytesTransferred())/task.getTotalByteCount();
int bytes = task.getBytesTransferred();
String progress = String.format("%.2f", fprogress);
int constant = 1000;
if(bytes%constant == 0)
{
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(getApplicationContext())
.setSmallIcon(android.R.drawable.stat_sys_download)
.setContentTitle("Downloading " + model.getName())
.setContentText(" " + progress + "% completed");
NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.notify(mId, mBuilder.build());
}
}
助けてくれてありがとう! –
私のキャリアに役立つように、それが正しいと答えてください。 –