I've never worked with the Dropbox API before and I noticed there's 2 APIs available the Core and Sync, and I don't know which one I should be using. Here's a bit about what I'm trying to do:
A simple two-way sync that mirrors a folder on the users Dropbox to the device, and vice versa. The folder could contain any files there of any type. When making the App on the App Console it asked for permissions and it seems the full dropbox permission is only compatible with the Core API.
Is anyone able to clarify which API I would need to be using? Thanks!
EDIT: I created an app with full dropbox permissions, this failed to work with the Sync API (as stated on the creation page), so instead I made another app allowing text files, then created a .dat file, which resulted in the following error:
DROPBOX_DISALLOWED: sync.hpp:300: app is not allowed to create file p(/c7/r6/t4.dat)
Is there any way around this particularly issue or will I have to use the Core API? Seems a bit limiting that the apps can only work with certain file types only.
EDIT2: My code using to test right now:
public void SyncTest() {
try {
DbxFileSystem dbxFs = DbxFileSystem.forAccount(mDbxAcctMgr.getLinkedAccount());
DbxFile testFile = dbxFs.create(new DbxPath(getString(R.string.remote_path) + "hello.dat"));
try {
testFile.writeString("Hello Dropbox!");
} catch(IOException ioe) {
} finally {
testFile.close();
dbxFs.syncNowAndWait();
}
} catch(com.dropbox.sync.android.DbxException.Unauthorized ue) {
alert(getString(R.string.unauth));
} catch (com.dropbox.sync.android.DbxException se) {
}
}
App permission type is "text files". When using an app with "Full dropbox" I get a different error:
DROPBOX_ERROR_USAGE: sync.cpp:244: This app is not allowed to use the Sync API for file access.