I would like to obtain like some this:
But I don't know how I can to obtain the percentage.
I've read this posts:
But I haven't gotten any good result =(
¿Any idea?
I can get the total size and the bytes downloaded for a file, but I don't know how I can get that the progress bar shows these information in a percentage wa
int sizeIndex = c.getColumnIndex(DownloadManager.COLUMN_TOTAL_SIZE_BYTES);
int downloadedIndex = c.getColumnIndex(DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR);
int size = c.getInt(sizeIndex);
int downloaded = c.getInt(downloadedIndex);
int percentage = (downloaded * 100 / size);