Upload images to Azure Blob Storage from an Android device With Offline Sync

孤街醉人 提交于 2019-12-12 02:28:16

问题


From My android Application want to Capture a Image ,With a Text Field.

Text fields Data need to Save In Local Sqlite Database(Like TodoItem Table) ,Image will Save in Sdcard With Offline.

When Internet Comes Image Need to Sync in Azure Blob Storage, Text data need to Sync in Azure Todoitem Server Table.

I tried Below Links, for Offline Data Sync is Working. But Offline Image Upload to Azure not able to find Any code or Link.

Please help me to Find the solution

Link I tried for Image Upload to Azure Online Mode

Offline Data Sync


回答1:


This is not possible in todays Android SDK. As a result, you will end up rolling your own offline sync for images. Sync logic for static stuff tends to be easy - you read the file list from the SD, generate an API for the server that reads the list from blob or (more appropriately) Azure File Storage and compare the two. Since your list is static, you can download files that are not on the SD card and upload files that are not on the server.

There are two issues you need to deal with if your files are not static. First is updates - generally, files tend to deal with "latest file wins" so you can check and compare the last write timestamp. The second is "deleted files". If you do "deleted files", you will need to create a sync table for the file list (and the Azure Mobile Apps SDK will help you there) - then check your SD card after the sync for files that are on the SD card but not in the table - those should be removed.




回答2:


The Azure Mobile Apps SDK always contained support for online/offline sync of data, but was recently updated to include support for files. To see how to add offline file sync to your iOS, Android, and Windows 10 apps, check out the linked post.



来源:https://stackoverflow.com/questions/34742786/upload-images-to-azure-blob-storage-from-an-android-device-with-offline-sync

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!