DataItem

public interface DataItem implements Freezable<DataItem>

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.

A DataItem is identified by its Uri, which contains its creator and a path.

See Also

Public Method Summary

abstract Map<StringDataItemAsset>
getAssets()
A map of Assets associated with this DataItem.
abstract byte[]
getData()
An array of data stored at the specified Uri.
abstract Uri
getUri()
Returns the DataItem's Uri.
abstract DataItem
setData(byte[] data)
Sets the data in a DataItem.

Inherited Method Summary

Public Methods

public abstract Map<StringDataItemAsset> getAssets ()

A map of Assets associated with this DataItem. DataMapItem may be used to store structured data in the network, including Assets.

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 ()

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

public abstract DataItem setData (byte[] data)

Sets the data in a DataItem.

The current maximum DataItem 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. null is only allowed for backwards compatibility.