Forum Discussion

RedAid's avatar
RedAid
New member | Level 2
7 years ago

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

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff
    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

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,950 PostsLatest Activity: 8 hours ago
351 Following

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 or Facebook.

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!