DataItem | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Methods | Inherited Methods | [Expand All]
public interface

# DataItem

implements Freezable<T>

com.google.android.gms.wearable.DataItem

## Class Overview

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

- `DataMapItem`

## Summary

Public Methods
abstract Map<String, DataItemAsset> | getAssets() A map of assets associated with this data item.
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 data item.

[Expand] Inherited Methods
From interface com.google.android.gms.common.data.Freezable
abstract T | freeze() Freeze a volatile representation into an immutable representation.
abstract boolean | isDataValid() Check to see if this object is valid for use.

## Public Methods

#### public abstract Map<String, DataItemAsset> getAssets ()

A map of assets associated with this data item. `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. `getHost()` returns the id of the node that created it.

#### public abstract DataItem setData (byte[] data)

Sets the data in a data item.

The current maximum data item size limit is approximtely 100k. Data items should generally be much smaller than this limit.