DataItem
Stay organized with collections
Save and categorize content based on your preferences.
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
Asset
s.
A DataItem
is
identified by its Uri, which contains its creator and a path.
Inherited Method Summary
From interface
com.google.android.gms.common.data.Freezable
abstract DataItem
|
freeze()
|
abstract boolean |
isDataValid()
|
Public Methods
public abstract byte[]
getData ()
An array of data stored at the specified Uri
. DataMapItem
may be used to store structured data in the network.
public abstract Uri getUri ()
public abstract DataItem
setData (byte[]
data)
Sets the data in a DataItem
.
The current maximum DataItem
size limit is approximately 100k. DataItem
s
should generally be much smaller than this limit.
Note: Use an empty array if there is no data to store. null
is only
allowed for backwards compatibility.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["`DataItem` is the fundamental object for storing data within the Android Wear network, replicating across all connected devices."],["It comprises a small data blob and related `Asset`s, identifiable by a unique URI indicating its creator and path."],["`DataItem` provides methods to access and manipulate its associated data and assets, including `getAssets()`, `getData()`, `getUri()`, and `setData()`."],["`DataMapItem` can be utilized to manage structured data and `Asset`s within the `DataItem`."],["The maximum size for a `DataItem` is around 100KB, although it is recommended to keep them considerably smaller."]]],[]]