Android Wear DataMap条目保持有效时间 [英] Android Wear How Long do DataMap entries Stay Valid

查看:54
本文介绍了Android Wear DataMap条目保持有效时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在扩展我的一个应用程序以使其与Android Wear兼容,并且我需要向Wear发送4个位图。我正在使用 DataApi DataMap 来做到这一点,并且目前工作正常。

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.

我的问题是,数据在 DataApi 中保持同步多长时间?一个星期后,我仍然可以访问它们吗?是我必须手动管理的事情。例如,如果手机上的某些状态发生变化,我将需要发送不同的位图。我是否需要删除当前存在的那些文件?

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?

推荐答案

文档在这一点上并不具体,但我认为除非您清理它们(否则我的应用程序会被卸载),它们将永远存在。 DataItem 定义为:

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:


存储在Android Wear网络中的数据的基础对象。 DataItem
跨网络中的所有设备复制。它包含一小部分
数据和相关资产。

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.

由于它被描述为存储 (而不是消息),我想一旦存储它们便是永久的,直到您删除它们。您可以将其视为应用程序私有数据目录的扩展(仅此存储及其同步是直接由Google Play服务应用程序管理,而不是您自己的)。

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. ;)

这篇关于Android Wear DataMap条目保持有效时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆