使用 Shared Preferences 持久化 DataMap android wear

Using Shared Preferences to persist DataMap android wear

我有一个与 FORM Watch Face. I see that SharedPreferences have been used to persist DataMap 有关的问题。当我们可以随时从 Wearable.DataApi 中获取 DataMap 时,为什么有必要保留数据? developer.android 可穿戴设备文档未提及在任何地方使用共享首选项,甚至 Android 可穿戴设备示例也不使用 SharedPreferences。是为了性能还是我在这里遗漏了什么?

Roman Nurik 在这里发布了一个答案: https://plus.google.com/111335419682524529959/posts/QJcExn49ZrR

For performance. When the settings activity loads of the watch first shows up, I didn't want to wait for an IPC call to complete before showing anything

有关详细说明,请查看我的 medium post