I've been following the guide on implementing APK expansion files, and I've hit a bit of a snafu with the Downloader Library (example implementation, which I've been following). The IDownloaderClient interface has the following method defined:
onDownloadProgress(DownloadProgressInfo progress)
The download service calls this to deliver a DownloadProgressInfo object, which describes various information about the download progress, including estimated time remaining, current speed, overall progress, and total so you can update the download progress UI.
This is implemented as:
@Override
public void onDownloadProgress(DownloadProgressInfo progress) {
mAverageSpeed.setText(getString(R.string.kilobytes_per_second,
Helpers.getSpeedString(progress.mCurrentSpeed)));
mTimeRemaining.setText(getString(R.string.time_remaining,
Helpers.getTimeRemaining(progress.mTimeRemaining)));
progress.mOverallTotal = progress.mOverallTotal;
mPB.setMax((int) (progress.mOverallTotal >> 8));
mPB.setProgress((int) (progress.mOverallProgress >> 8));
mProgressPercent.setText(Long.toString(progress.mOverallProgress
* 100 /
progress.mOverallTotal) + "%");
mProgressFraction.setText(Helpers.getDownloadProgressString
(progress.mOverallProgress,
progress.mOverallTotal));
}
The problem is, no matter what I do I simply cannot get my downloader UI to update. I've tried invalidating, postInvalidating, running in a separate thread, etc. If I've overlooked some key portion of the sample implementation, please point it out to me, but I can't seem to find it. I've poured over my code and over the sample all day... Any ideas why I can't get the UI to update? It's literally the last thing keeping me from publishing my app. Thanks.