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.

how to get download progress when resume

See original GitHub issue

Is it able to set setOnProgressListener when calling PRDownloader.resume(downloadId);?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
Od1nikcommented, Feb 22, 2019

@xuanzhui Java code:

downloadIdOne = PRDownloader.download(URL1, dirPath, "facebook.apk")
                        .build()
                        .setOnStartOrResumeListener(new OnStartOrResumeListener() {
                            @Override
                            public void onStartOrResume() {
                                
                            }
                        })
                        .setOnPauseListener(new OnPauseListener() {
                            @Override
                            public void onPause() {
                                
                            }
                        })
                        .setOnCancelListener(new OnCancelListener() {
                            @Override
                            public void onCancel() {
                               
                            }
                        })
                        .setOnProgressListener(new OnProgressListener() {
                            @Override
                            public void onProgress(Progress progress) {
                                
                            }
                        })
                        .start(new OnDownloadListener() {
                            @Override
                            public void onDownloadComplete() {
                                
                            } 
1reaction
Od1nikcommented, Feb 22, 2019

@xuanzhui Kotlin code:

val downloadId = PRDownloader.download(URL, dir, fileName)
            .build().setOnStartOrResumeListener(object: OnStartOrResumeListener {
                override fun onStartOrResume() {
                    Log.d(TAG, "onStartOrResume")
                }
            })
            .setOnCancelListener(object: OnCancelListener {
                override fun onCancel() {
                    Log.d(TAG, "onCancel")
                }
            })
            .setOnProgressListener(object: OnProgressListener {
                override fun onProgress(progress: Progress?) {
                    val percent = progress!!.currentBytes * 100 / progress.totalBytes

                }
            })
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Resume a Download After a Lost Connection
1. Click the gear icon. · 2. Click "View Downloads" to open the Download Manager. · 3. Click on the "Resume" button next...
Read more >
how to get download progress when resume #102 - GitHub
So the answer is correct, starting a "new download" will resume the old one, if you use the same parameters. I assume, at...
Read more >
How to resume downloading files and show the progress in java
How to resume downloading files and show the progress in java ; url = new ; URL(urlFile); HttpURLConnection urlConnection ; = (HttpURLConnection) ...
Read more >
Pausing and Resuming Downloads - Apple Developer
When it's appropriate to resume the download, create a new URLSessionDownloadTask by using the downloadTask(withResumeData:) or downloadTask(withResumeData: ...
Read more >
Will download lose progress or start over when i pause ...
Since you're downloading a large file/application, I suggest that leave your computer open until the download progress is done. Or try to search ......
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