question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Downloading file progress bug

See original GitHub issue

Hi creator of this useful library. I try download large file 80mb. So, exactly downloading of file are complete without bug. But onProgress method, stop call sometime are magically principe, and never called while file will be downloaded completely. What I’m do wrong ? Please help me.

final File temp = Tool.createTempFile();

        AndroidNetworking.download(url, temp.getParentFile().getPath(), temp.getName())
                .setTag("downloadFile")
                .setPriority(Priority.HIGH)
                .build()
                .setDownloadProgressListener(new DownloadProgressListener() {

                    private int prevProgress;

                    @Override
                    public void onProgress(final long bytesDownloaded, final long totalBytes) {
                        final int progress = (int) (bytesDownloaded * 100 / totalBytes);

                        if (progress != prevProgress) {
                                    progressBar.setProgress(progress);
                                    percent.setText(progress + " %");
                                    prevProgress = progress;

                                    Log.e("progress", "total = " + totalBytes +
                                            " loaded = " + bytesDownloaded + " percentage = " + progress + "%");
                       }
                    }
                })
                .startDownload(new DownloadListener() {
                    @Override
                    public void onDownloadComplete() {
                        progressBar.setProgress(100);
                        cancel.setEnabled(false);
                        IntentFilter filter = new IntentFilter();
                        filter.addAction(DataImportService.SERVICE_FILTER);
                        activity.registerReceiver(broadcastReceiver, filter);
                    }

                    @Override
                    public void onError(ANError error) {
                        progressBar.setVisibility(View.GONE);
                        progressBar.setProgress(0);
                        percent.setText(getContext().getResources().getString());
                        dismiss();
                    }
                });

        progressBar.setProgress(0);
        progressBar.setVisibility(View.VISIBLE);

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
smail2133commented, Mar 18, 2017

It’s works. Thank you. Good job.

Best regards, Evgeny

18 марта 2017 г., в 09:13, AMIT SHEKHAR notifications@github.com написал(а):

Fixed and uploaded the new version, but the final version will be released with more features and fixes. You can use the below:

compile ‘com.amitshekhar.android:android-networking:0.5.0-RC1’

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/amitshekhariitbhu/Fast-Android-Networking/issues/96#issuecomment-287522090, or mute the thread https://github.com/notifications/unsubscribe-auth/AFNhsa3wLg20Pyzz00SX6Ohgw4YMOvwrks5rm4QdgaJpZM4MgwTM.

1reaction
amitshekhariitbhucommented, Mar 18, 2017

@smail2133 : Try it and give me feedback

Read more comments on GitHub >

github_iconTop Results From Across the Web

All browsers download progress not showing and File Explorer
Hi, I figured out why my download progress bar wasn't showing in browser, it was an app and an extension blocking it. Thanks...
Read more >
Download in progress but cuts out: how to fix this bug in Chrome
A download in progress is cut off in Chrome · Check for corrupted downloads · Check if any extension is interfering · See...
Read more >
[Bug] Negative Downloading Progress while ... - GitHub
Steps to reproduce. Open any video link of drive.google.com, and click download logo on the website page
Read more >
Closing Chrome browser gets Download progress stop dialog ...
Issue 145085: Closing Chrome browser gets Download progress stop dialog, ... Please specify Area-* of the system to which this bug/feature applies.
Read more >
When downloading extensions, the progress bar indicating ...
When downloading extensions, the progress bar indicating download progress does not update while downloading, then updates to 100% when complete.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found