Android Wear How Long do DataMap entries Stay Valid
Asked Answered
T

1

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?

Tableau answered 10/7, 2014 at 0:10 Comment(1)
can you show me the code for sending dataAeronaut
D
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. ;)

Dandle answered 10/7, 2014 at 2:37 Comment(5)
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...Tableau
@Tableau Yes, please report your findings. I'm sorry the answer is conjecture/inconclusive, but there isn't much information available at this point :/Dandle
@Tableau did you ever run your long test? Eight months later, what is your experience on the longevity of DataItems?Goldie
@String I actually sold me wear device a few months ago, but I didn't have any issues with assuming they live forever.Tableau
@Dandle you're answer was pretty useful for me. Thank'sDysentery

© 2022 - 2024 — McMap. All rights reserved.