cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 

Syncing on Background - Best Practice

Check S. New member | Level 1
New member | Level 1

Hello,

I'd like to implement simple sync functionality into my App. The goal is to read JSON data from file (On Dropbox) and update my SQLite data and vice versa. Users must be allowed to use App during sync process. I consider to use Dropbox Sync API and call syncing from (Intent)Service.

I see a few problems which could appear:

1.) App is minimized (paused) while syncing
2.) App is closed (killed) while syncing
3.) In some cases, sync scenario needs User input (for example: "Do you want to replace data in your device?" dialog)

Is there any "Best practice" or recommendation how to implement this functionality? It would be greatly appreciated if somebody could help with this problem.

Tom

1 Reply 1

Re: Syncing on Background - Best Practice

Dropboxer
Dropboxer

If you're using the Sync API, you should work through the tutorial to see how it's recommended apps use the API to upload and download files, use listeners, etc.:

https://www.dropbox.com/developers/sync/start/android

Alternatively, you can use the Core API, which may be more straightforward if you just need to upload/download a single file:

https://www.dropbox.com/developers/core/start/android

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?