I'm using the Dropbox Sync API in a Android app to put Photo's on Dropbox. The photos are stored in a DbxFile. Immediately after the creation of the files, I can re-open them without any problem, but once the files are uploaded, I can't open about half of the files on the mobile device. (On my PC, they are ok.) With the files that are no longer accessible, the Sync api seems to know there is a newer version, but for some reason they are not updated.
public Bitmap getBitmapFromFile(String path) throws Exception {
DbxFile dbxFile = dbxFileSystem.open(new DbxPath(path));
DbxFileStatus newerStatus = dbxFile.getNewerStatus();
if (newerStatus != null && newerStatus.isCached) {
// this is +/- one-half of the time the case. Appears to be random?
dbxFile.update(); //This is executed, but no update??
}
Bitmap bitMap = BitmapFactory.decodeStream(dbxFile.getReadStream());
dbxFile.close();
return bitMap;
}
When I try to open a file that is no longer accessible, this line appears in LogCat:
libDropboxSync.so(open) file.cpp:329: opening at (da618e76aab is latest)
By opening a file without problems, this line appears:
libDropboxSync.so(open) file.cpp:336: opening at da418e76aab (latest)
Why is the update not executed? Any help is highly appreciated, thanks.