Search code examples
androidsharedpreferencesandroid-wear-data-api

Using Shared Preferences to persist DataMap android wear


I had a question related to the FORM Watch Face. I see that SharedPreferences have been used to persist DataMap. Why was it necessary to persist the data when we can fetch the DataMap from the Wearable.DataApi anytime? The developer.android wearable documentation does not mention using Shared Preferences anywhere and even the Android wear samples do not use SharedPreferences. Is it for performance or am I missing something here?


Solution

  • Roman Nurik posted an answer here: 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

    For a detailed description checkout my medium post.