Asset

public class Asset extends Object
implements Parcelable Parcelable

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. A DataItemAsset represents an Asset after it has been added to the network through a PutDataRequest .

Inherited Constant Summary

Field Summary

public static final Creator < Asset > CREATOR

Public Method Summary

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.
boolean
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
String
void
writeToParcel ( Parcel dest, int flags)

Inherited Method Summary

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 DataClient.putDataItem(PutDataRequest) request.

The Wearable API will copy the file descriptor's data in the caller's process as soon as the corresponding PutDataRequest is provided to the API.

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. The Asset will be opened using ContentResolver.openFileDescriptor(Uri, String) .

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)

Create a Mobile Website
View Site in Mobile | Classic
Share by: