简体   繁体   English

Dropbox Android同步API

[英]Dropbox Android Sync API

I'm using this API in order to read an Excel file from Dropbox. 我正在使用此API以便从Dropbox读取Excel文件。 I read the file and save the rows in an ArrayList. 我读取文件并将行保存在ArrayList中。 Then I close the stream (dbxFile.close()). 然后,我关闭流(dbxFile.close())。

It's working fine but this log messages appear a lot of times when I've already downloaded the file and I am doing another completely different task. 它工作正常,但是当我已经下载文件并且正在执行另一项完全不同的任务时,此日志消息会出现很多次。

libDropboxSync.so(sync) sync.c:80: calling /delta...
com.dropbox.sync.android.NativeHttp Sending HTTP POST
com.dropbox.sync.android.NativeHttp HTTP POST status 200
libDropboxSync.so(sync) sync.c:86: handling /delta responses...
libDropboxSync.so(api) api.c:511: processed 0 delta entries: 0.000032 sec
libDropboxSync.so(sync) sync.c:209: sync done
... 

It is normal? 这是正常的? I guess that Dropbox wants to have the latest version of the file, but those log messages appear and appear and it doesn't look like it's going to stop. 我猜想Dropbox想要拥有该文件的最新版本,但是这些日志消息不断出现,而且看起来好像不会停止。

Thanks. 谢谢。

Sync API regularly fetches delta from Dropbox to keep the local and remote copy in sync. Sync API会定期从Dropbox提取增量,以使本地和远程副本保持同步。 It is expected that you're seeing sync attempts. 预计您会看到同步尝试。

Is this helps? 这有帮助吗?

You should avoid having files open or listeners registered while your app isn't on the screen. 当您的应用程序不在屏幕上时,应避免打开文件或注册监听器。 Both are hints to the Sync API that you're actively watching for changes, and will cause it to update more frequently in the background, which consumes power. 两者都向Sync API暗示您正在积极监视更改,并将使它在后台更频繁地更新,这会消耗大量电量。 Use your onPause() method to remove listeners and close files, then use onResume() to restore them as necessary. 使用onPause()方法删除侦听器并关闭文件,然后根据需要使用onResume()还原它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM