Android Wear How Long do DataMap entries Stay Valid

杀马特。学长 韩版系。学妹 提交于 2019-12-07 05:20:58

问题


I'm extending one of my apps to work with Android Wear, and I need to send 4 bitmaps to Wear. I'm using the DataApi and DataMap to do this and it is currently working fine.

My question is, how long does data stay synced in the DataApi? Would I still be able to access them a week later? Is it something I have to manually manage. For instance, if some state would change on the handset, I would need to send different bitmaps. Do I need to remove the ones that are currently there?


回答1:


The documentation is not specific on this point, but I would assume they will stay there forever, unless you clean them (or your app is uninstalled, I guess). A DataItem is defined as:

The base object of data stored in the Android Wear network. DataItem are replicated across all devices in the network. It contains a small blob of data and associated assets.

Since it's described as storage (and not messaging) I guess that once stored they are permanent, until you delete them. You could think of this as an extension of the private data directory of your application (only this storage, and its synchronization, is directly managed by the Google Play Services app instead of your own).

As for "a week later", I have concrete evidence: a few ints I stored last week are still there. ;)



来源:https://stackoverflow.com/questions/24665609/android-wear-how-long-do-datamap-entries-stay-valid

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