cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can i get lifetime Access Token

How can i get lifetime Access Token

Ghost Mjrm
Explorer | Level 4

i have android app connected to my Dropbox folder using access token but every 4 hour should i edit my code and input the new access token is there any method to make the app working 24h without any interact from me

and fix the message that show access token error uploading to Dropbox: expired access token

 

 

private void uploadToDropbox(File photoFile) {
if (photoFile == null || !photoFile.exists()) {
runOnUiThread(() -> Toast.makeText(MainActivity.this, "Error: Photo file does not exist", Toast.LENGTH_SHORT).show());
return;
}

DbxRequestConfig config = DbxRequestConfig.newBuilder("Decamera").build();
DbxClientV2 client = new DbxClientV2(config, DROPBOX_ACCESS_TOKEN);

try {
String remotePath = "/Decamera/" + photoFile.getName();

try (InputStream in = new FileInputStream(photoFile)) {
client.files().uploadBuilder(remotePath)
.withMode(WriteMode.ADD)
.uploadAndFinish(in);

runOnUiThread(() -> Toast.makeText(MainActivity.this, "Photo uploaded to Dropbox", Toast.LENGTH_SHORT).show());
}

} catch (Exception e) {
e.printStackTrace();
runOnUiThread(() -> Toast.makeText(MainActivity.this, "Error uploading to Dropbox: " + e.getMessage(), Toast.LENGTH_SHORT).show());
}
}
private static final String DROPBOX_ACCESS_TOKEN = my access token

 

41 Replies 41

Здравко
Legendary | Level 20

Ok, sorry, the words just lipped out. I just don't know how to say that such sources are unreliable and how many time to repeat that so it would reach to you. Even more you should be more critical and shouldn't accept such things so... naively believing in them, even when clearly visible they are incorrect. As I said, you're violating TOS too!

AI of any kind will never replace humans intelligence. Don't try replace your own intelligence with something that cannot be better (even in theory). AI could be a good tool, but never replacement.

Good luck.

Ghost Mjrm
Explorer | Level 4
Thank you for your advice it came at the right time
Good luck to you too
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Ghost Mjrm Explorer | Level 4
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?