AI-generated Key Takeaways
-
Asset
objects represent binary blobs shared between data items in the Android Wear network, replicating on demand. -
You can create
Asset
objects from various sources like byte arrays, file descriptors, existing digests, or content URIs. -
Asset
provides methods to access its data via digest, file descriptor, or URI. -
DataItemAsset
represents anAsset
that's been added to the network through aPutDataRequest
. -
The Wearable API copies the file descriptor's data when the
PutDataRequest
is provided, so you should close the FD afterwards.
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 | |
static Asset | |
static Asset | |
boolean | |
String | |
ParcelFileDescriptor | |
Uri | |
int |
hashCode()
|
String |
toString()
|
void |
writeToParcel(Parcel dest, int
flags)
|
Inherited Method Summary
Fields
Public Methods
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 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 ()
public ParcelFileDescriptor getFd ()
Returns the file descriptor referencing the Asset
.