DataItem

public interfaceDataItemimplementsFreezable<DataItem>

The base object of data stored in the Android Wear network.DataItemare replicated across all devices in the network. It contains a small blob of data and associated Assets.

ADataItemis identified by its Uri, which contains its creator and a path.

See Also

Public Method Summary

abstractMap<String,DataItemAsset>
getAssets()
A map ofAssets associated with thisDataItem.
abstract byte[]
getData()
An array of data stored at the specifiedUri.
abstractUri
getUri()
Returns theDataItem's Uri.
abstractDataItem
setData(byte[] data)
Sets the data in aDataItem.

Inherited Method Summary

Public Methods

public abstractMap<String,DataItemAsset> getAssets()

A map ofAssets associated with thisDataItem. DataMapItem may be used to store structured data in the network, includingAssets.

public abstract byte[] getData()

An array of data stored at the specifiedUri.DataMapItem may be used to store structured data in the network.

public abstractUrigetUri()

Returns theDataItem's Uri.Uri.getHost() returns the id of the node that created it.

public abstractDataItem setData(byte[] data)

Sets the data in aDataItem.

The current maximumDataItem size limit is approximately 100k.DataItems should generally be much smaller than this limit.

Note: Use an empty array if there is no data to store.nullis only allowed for backwards compatibility.