Image files sync in Azure Mobile Apps for Android

2019-06-11 05:58发布

问题:

Sorry if this question does not contain any code. I am building an Android app using Azure Mobile Apps. I am successfully following the sample with the TodoList . The sample describes the case for data sync, but what if I want to add support for images sync? Do I have to save the image files as blob inside the database? Do I treat files as any other record in the db, or is there a better way? Do I have to use a service other than "Mobile Apps"?

I've also read the following instructions about image sync, but they don't seem to target Android:

Azure Mobile Apps - structured data sync with files

回答1:

I've also read the following instructions about image sync, but they don't seem to target Android:

The assemblies used for file sync is a prerelease version. I suggest you implement the file sync feature for your Android device by yourself currently. To implement the sync feature, I suggest you create a table to store the file log. The table definition should be like this.

+-------------------+
|    Column Name    |
+-------------------+
| File name         |
| Operation type    |
| Modified date     |
+-------------------+

After created or deleted the file on your device, we need to add a log record to the file log table. To sync the files, we need to compare the differences between local data and remote data on this table to sync the files.