Asset | 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: Inherited Constants | Fields | Methods | Inherited Methods | [Expand All]
public class

# Asset

extends Object
implements SafeParcelable

java.lang.Object
↳ | com.google.android.gms.wearable.Asset

## Class Overview

An asset is a binary blob shared between data items that is replicated across the wearable network on demand.

It may represent an asset not yet added with the Android Wear network. `DataItemAsset`s are representations of an asset after it has been added to the network through a `PutDataRequest`.

## Summary

[Expand] Inherited Constants
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |
From interface com.google.android.gms.common.internal.safeparcel.SafeParcelable
String | NULL |

Fields
public static final Creator<Asset> | CREATOR |

Public Methods
static Asset | createFromBytes(byte[] assetData) Creates an Asset using a byte array.
static Asset | createFromFd(ParcelFileDescriptor fd) Creates an Asset using a file descriptor.
static Asset | createFromRef(String digest) Create an Asset using an existing Asset's digest.
static Asset | createFromUri(Uri uri) Creates an Asset using a content URI.
int | describeContents()
boolean | equals(Object o)
String | getDigest() Returns the digest associated with the asset data.
ParcelFileDescriptor | getFd() Returns the file descriptor referencing the asset.
Uri | getUri() Returns the uri referencing the asset data.
int | hashCode()
String | toString()
void | writeToParcel(Parcel dest, int flags)

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)

## Fields

#### public static final Creator<Asset> CREATOR

## Public Methods

#### public static Asset createFromBytes (byte[] assetData)

Creates an Asset using a byte array.

#### public static Asset createFromFd (ParcelFileDescriptor fd)

Creates an Asset using a file descriptor. The FD should be closed after being successfully sent in a putDataItem request.

#### public static Asset createFromRef (String digest)

Create an Asset using an existing Asset's digest.

#### public static Asset createFromUri (Uri uri)

Creates an Asset using a content URI. Google Play services must have permission to read this Uri.

#### public int describeContents ()

#### public boolean equals (Object o)

#### public String getDigest ()

Returns the digest associated with the asset data. A digest is a content identifier used to identify the asset across devices.

##### Returns

- the Asset's digest, or null if the digest is unset

#### public ParcelFileDescriptor getFd ()

Returns the file descriptor referencing the asset.

#### public Uri getUri ()

Returns the uri referencing the asset data.

#### public int hashCode ()

#### public String toString ()

#### public void writeToParcel (Parcel dest, int flags)