We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
RedAid
8 years agoNew member | Level 2
cannot download fils from Dropbox
hi, i'm trying this code
public static String path= Environment.getExternalStorageDirectory().getAbsolutePath()+"/Bac/";
public static String DropboxDownloadPathFrom = "BacMath/tst.txt";
public static String DropboxDownloadPathTo = path+"dd";
// public static String dropboxdirpath="/storage/emulated/0/DropboxItems/";
public static File Dir=new File(path);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.aa);
AndroidAuthSession session = buildSession();
dropboxAPI = new DropboxAPI<AndroidAuthSession>(session);
Dir.mkdir();
Button b=(Button) findViewById(R.id.az);
b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DownloadFromDropboxFromPath(DropboxDownloadPathTo,DropboxDownloadPathFrom);
}
});
}
but no file is downloaded
1 Reply
- Greg-DB8 years ago
Dropbox Community Moderator
I'll be happy to help with any issues you're having with the Dropbox API, but I'll need some more information. Please reply with:
- the name and version of the platform and SDK/library you are using
- the full text of the error or any unexpected output
- the steps to reproduce the issue, including relevant code snippet(s). You didn't include the definition of DownloadFromDropboxFromPath, for example, which would be helpful.
Looking at the code you included though, it looks you're using the old Android SDK, which uses API v1, which is now retired.
You should instead using the latest version of the Dropbox API v2 Java SDK:
https://github.com/dropbox/dropbox-sdk-java
There's an example Android app here:
https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/android
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!