5

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?

Eliezer
  • 7,209
  • 12
  • 56
  • 103

1 Answers1

8

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

matiash
  • 54,791
  • 16
  • 125
  • 154
  • I'll have to run a long test of my own to see if it'll stay forever since I'm storing 400K at a time. Although it shouldn't make a difference... – Eliezer Jul 10 '14 at 03:34
  • @Eliezer Yes, please report your findings. I'm sorry the answer is conjecture/inconclusive, but there isn't much information available at this point :/ – matiash Jul 10 '14 at 03:41
  • @Eliezer did you ever run your long test? Eight months later, what is your experience on the longevity of DataItems? – Sterling Mar 04 '15 at 04:36
  • 1
    @String I actually sold me wear device a few months ago, but I didn't have any issues with assuming they live forever. – Eliezer Mar 04 '15 at 04:38
  • @matiash you're answer was pretty useful for me. Thank's – Marco Apr 16 '15 at 13:52