-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No method to get the file downloading/uploading progress #66
Comments
|
The API v2 Java SDK doesn't offer progress listeners, but we'll consider this a feature request. (The v2 Java SDK isn't built on the v1 Android Core SDK, so it didn't inherit the progress listeners from there.) |
|
Hi @greg-db. Is it possible to know when could we expect it to be done? We would like to migrate to v2 on our android app, but we do not want to lose functionality. If user is downloading a file, user wants to know how is the progress of the download going. Even in Java I think it is an important thing to have, isn't it? I'm not talking of a ProgressListener android specific, but at least a callback to get notified. Looking at the code seems to be closed for extension. |
|
I don't have a timeline to offer for this unfortunately. Apologies I don't have any more useful to share! |
|
@greg-db, may I know which version of the SDK you are using for the android dropbox app? I've got installed on my phone dropbox version 15.2.2 and on this apk there is a progressbar both for the downloads and for the uploads. Are you using a different API? |
|
@thekindJose: As a workaround, you can create a wrapper public class ProgressOutputStream extends OutputStream {
...
public ProgressOutputStream(long totalSize, OutputStream underlying, Listener listener) {
this.underlying = underlying;
this.listener = listener;
this.completed = 0;
this.totalSize = totalSize;
}
@Override
public void write(byte[] data, int off, int len) throws IOException {
this.underlying.write(data, off, len);
track(len);
}
@Override
public void write(byte[] data) throws IOException {
this.underlying.write(data);
track(data.length);
}
@Override
public void write(int c) {
this.underlying.write(c);
track(1)
}
private void track(int len) {
this.completed += len;
this.listener.progress(this.completed, this.totalSize);
}
public interface Listener {
public void progress(long completed, long totalSize);
}
}Then, with the SDK: DbxClientV2 client = ...
DbxDownloader<FileMetadata> dl = client.files().download("/remote-file-path");
long size = dl.getResult().size;
FileOutputStream fout = new FileOutputStream("local-file");
dl.download(new ProgressOutputStream(size, fout, new ProgressOutputStream.Listener() {
void progress(long completed, long totalSize) {
// update progress bar here ...
}
}); |
|
Hi @cakoose, i used your method,it was just worked by downloading.When i used InputStream to resovle the upload,it doesn't work.Code like this: This method just lisenning local stream but not remote.Could you help me ?Thanks! |
|
+1. to show uploading progress is quite a basic and required function, hope this function can be added as soon as possible |
|
+1 I am also surprised that such an essential feature is not included. |
|
an essential feature is not included. |
|
And you just retired the V1 API without this essential feature in the new V2 api you are promoting ;( |
|
@cakoose already provided a method to wrap OutputStream and tracking download progress. For Uploading. In V1 android SDK we provided a convenient class ChunkedUploader. In API V2 we no longer provide it but its actually quite simple to implement your own. You can split you file into small chunks and send them through |
|
@jiuyangzhao don't you think this solution is a little complicated? you should provide a friendly API for upload progress :) . By the way, there's a bug in your chunked upload: #88 |
|
The whole point of using this library is that I don't want to be wrapping all the rest calls. |
|
Thanks for the feedback! I definitely see how it would be more helpful to offer a simplified interface for this. |
|
it's announced the dropbox api v1 will be retired as of 6/28/2017 but still no news to support ProgressMonitor? Without providing the essential function, how v1 can be retried and dropbox force all apps to move to v2? |
|
I don't have an update on this feature request right now. Note that we actually just announced a general extension for access to API v1 though, until 9/28/2017: https://blogs.dropbox.com/developers/2017/06/updated-api-v1-deprecation-timeline/ |
|
@LitbLeo thank your uploadProgress method,but i think it has a little mistake. |
|
Dear Dropbox team! You are forcing developers to migrate on v.2, but you have not provide essential API calls for it! More over, you are writing in your announcement
while developers ask you to provide in v.2 methods that exist in v.1 during last year! But you do nothing for this! Your announcement should be changed to:
The best way in this situation is do not turn off v.1 support until you are not write consistent v.2 release. |
|
Thanks for the additional feedback! I'm sending it to the team. |
|
Any update from DropBox? 9/28 is still the deadline without having any update from DropBox yet? |
|
I don't have an update on this feature request. I'll follow up here if/when I do. And yes, API v1 is planned for retirement on 9/28/17. You can find the full timeline and information in the blog post. |
|
just use the chunkedUploadFile method from here https://github.com/dropbox/dropbox-sdk-java/blob/7ecc15cf0f51d6ae2ba5cdb334aac2c2f3474b87/examples/upload-file/src/main/java/com/dropbox/core/examples/upload_file/Main.java |
|
Why the hell did you turn off the v1 API when v2 is clearly incomplete |
|
Chunked file upload, wow... 👎 You just made something trivial as monitoring progress, much more difficult. |
|
Thanks for the feedback everyone! @saorisato The "open with" test is just internal functionality for Dropbox's use. You can safely ignore that. Also, can you open an issue with the steps to reproduce and the stack trace for the crash your saw? Thanks in advance! |
|
I cannot believe that over a year after this issue was opened it is still not rectified. You guys do know that you are a leader in cloud storage, yet your API has no way to track the progress of an upload or download. |
|
The team should be shamed. |
|
@cakoose Thank you so much for the code for downloading :) Can we have also some code for uploading , i am braking stuff in house because the library doesn't have it lol . |
|
We will support this in next release. |
|
I will cry from happiness if this is true....
…On Sat, Jul 21, 2018, 02:25 jiuyangzhao ***@***.***> wrote:
We will support this in next release.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#66 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATbiwGZ7PfjIcfbnhhN3pOD1QKOzT44Mks5uImbTgaJpZM4Jzunw>
.
|
|
@jiuyangzhao When does the next release happen? |
|
Good question.... this feature is awaited 3 years now. I am ready to pay to
be added. ♥
…On Mon, Jul 30, 2018, 16:28 Alireza Omidi ***@***.***> wrote:
@jiuyangzhao <https://github.com/jiuyangzhao> When does the next release
happen?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#66 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATbiwORxnQ_luuEZ19N3_Pks8ZOHpy_pks5uLwoWgaJpZM4Jzunw>
.
|
|
@jiuyangzhao :) I see you added it , can we have the release i love you so much :) |
|
This has been released in v3.0.9. There's an example of using it with with the It works the same way with file downloads; the |
Hi,
I'm trying to integrate the v2 dropbox sdk into my android app.
I'm working on downloading files, but I cannot find anything in the API which notifies me regarding the downloading progress (as there was before on v1.6, i.e. the ProgressListener).
Am I missing something or have you removed this important feature?
Thanks!
The text was updated successfully, but these errors were encountered: