本文整理汇总了Java中com.google.android.gms.wearable.DataItemAsset类的典型用法代码示例。如果您正苦于以下问题:Java DataItemAsset类的具体用法?Java DataItemAsset怎么用?Java DataItemAsset使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataItemAsset类属于com.google.android.gms.wearable包,在下文中一共展示了DataItemAsset类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getByteArrayAsset
import com.google.android.gms.wearable.DataItemAsset; //导入依赖的package包/类
@Nullable
private byte[] getByteArrayAsset(@Nullable DataItemAsset asset, GoogleApiClient connectedApiClient) {
if (asset == null) {
return null;
}
InputStream inputStream = Wearable.DataApi.getFdForAsset(connectedApiClient, asset).await().getInputStream();
byte[] data = readFully(inputStream);
if (data != null) {
try {
inputStream.close();
} catch (IOException ignored) {
}
}
return data;
}
开发者ID:matejdro,项目名称:WearVibrationCenter,代码行数:18,代码来源:PhoneCommandListener.java
示例2: zza
import com.google.android.gms.wearable.DataItemAsset; //导入依赖的package包/类
static void zza(DataItemParcelable paramDataItemParcelable, Parcel paramParcel, int paramInt)
{
int i = zzb.zzH(paramParcel, 20293);
zzb.zzc(paramParcel, 1, paramDataItemParcelable.mVersionCode);
zzb.zza$377a007(paramParcel, 2, paramDataItemParcelable.mUri, paramInt);
Bundle localBundle = new Bundle();
localBundle.setClassLoader(DataItemAssetParcelable.class.getClassLoader());
Iterator localIterator = paramDataItemParcelable.zzcgg.entrySet().iterator();
while (localIterator.hasNext())
{
Map.Entry localEntry = (Map.Entry)localIterator.next();
localBundle.putParcelable((String)localEntry.getKey(), new DataItemAssetParcelable((DataItemAsset)localEntry.getValue()));
}
zzb.zza$f7bef55(paramParcel, 4, localBundle);
zzb.zza$52910762(paramParcel, 5, paramDataItemParcelable.mData);
zzb.zzI(paramParcel, i);
}
开发者ID:ChiangC,项目名称:FMTech,代码行数:18,代码来源:zzae.java
示例3: createStorableForPath
import com.google.android.gms.wearable.DataItemAsset; //导入依赖的package包/类
/**
* Transforms DataItem object to custom data container which type depends on given path type
*
* @param p
* @param item
* @param <E>
* @return
*/
public <E extends TimeStampStorable> E createStorableForPath(DataPath p, DataItem item) {
Class<? extends TimeStampStorable> clazz = p.getContainerClass();
if (clazz.getSimpleName().equals(EmptyCommand.class.getSimpleName())) {
return null;
}
try {
Map<String, DataItemAsset> assets = item.getAssets();
DataItemAsset asset = assets == null ? null : assets.get(DataPath.DEFAULT_ASSET_KEY);
if (asset == null) {
return (E) clazz.getConstructor(byte[].class).newInstance(item.getData());
} else {
// blocking call - asset receive
InputStream assetInputStream = Wearable.DataApi.getFdForAsset(
mGoogleApiClient, asset).await().getInputStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int nRead;
byte[] buffer = new byte[0x1000];
while ((nRead = assetInputStream.read(buffer, 0, buffer.length)) != -1) {
baos.write(buffer, 0, nRead);
}
return (E) clazz.getConstructor(byte[].class).newInstance(baos.toByteArray());
}
} catch (Exception e) {
Logger.logE("DataPath", "Constructor failed for " + p.name(), e);
return null;
}
}
开发者ID:asamm,项目名称:locus-addon-wearables,代码行数:36,代码来源:LocusWearCommService.java
示例4: toString
import com.google.android.gms.wearable.DataItemAsset; //导入依赖的package包/类
public final String toString()
{
boolean bool = Log.isLoggable("DataItem", 3);
byte[] arrayOfByte = getByteArray("data");
HashMap localHashMap = new HashMap(this.zzaSn);
for (int i = 0; i < this.zzaSn; i++)
{
zzac localzzac = new zzac(this.zzapd, i + this.zzars);
if (localzzac.getString("asset_key") != null) {
localHashMap.put(localzzac.getString("asset_key"), localzzac);
}
}
StringBuilder localStringBuilder1 = new StringBuilder("DataItemInternal{ ");
localStringBuilder1.append("uri=" + getUri());
StringBuilder localStringBuilder2 = new StringBuilder(", dataSz=");
if (arrayOfByte == null) {}
for (Object localObject = "null";; localObject = Integer.valueOf(arrayOfByte.length))
{
localStringBuilder1.append(localObject);
localStringBuilder1.append(", numAssets=" + localHashMap.size());
if ((!bool) || (localHashMap.isEmpty())) {
break label330;
}
localStringBuilder1.append(", assets=[");
Iterator localIterator = localHashMap.entrySet().iterator();
for (String str = ""; localIterator.hasNext(); str = ", ")
{
Map.Entry localEntry = (Map.Entry)localIterator.next();
localStringBuilder1.append(str + (String)localEntry.getKey() + ": " + ((DataItemAsset)localEntry.getValue()).getId());
}
}
localStringBuilder1.append("]");
label330:
localStringBuilder1.append(" }");
return localStringBuilder1.toString();
}
开发者ID:ChiangC,项目名称:FMTech,代码行数:37,代码来源:zzaf.java
示例5: getAssets
import com.google.android.gms.wearable.DataItemAsset; //导入依赖的package包/类
public Map<String, DataItemAsset> getAssets() {
Map<String, DataItemAsset> assets = new HashMap<String, DataItemAsset>();
this.assets.setClassLoader(DataItemAssetParcelable.class.getClassLoader());
for (String key : this.assets.keySet()) {
assets.put(key, (DataItemAssetParcelable) this.assets.getParcelable(key));
}
return assets;
}
开发者ID:microg,项目名称:android_external_GmsApi,代码行数:9,代码来源:DataItemParcelable.java
示例6: readAlbumArt
import com.google.android.gms.wearable.DataItemAsset; //导入依赖的package包/类
private void readAlbumArt(@NonNull final DataItem mediaItem) {
final Map<String, DataItemAsset> assets = mediaItem.getAssets();
if (assets != null) {
readAlbumArt(assets.get(DataPaths.Assets.ALBUM_ART));
}
}
开发者ID:Doctoror,项目名称:PainlessMusicPlayer,代码行数:7,代码来源:WearableListenerServiceImpl.java
示例7: DataItemAssetParcelable
import com.google.android.gms.wearable.DataItemAsset; //导入依赖的package包/类
public DataItemAssetParcelable(DataItemAsset paramDataItemAsset)
{
this.mVersionCode = 1;
this.zzyx = ((String)zzx.zzC(paramDataItemAsset.getId()));
this.zzvB = ((String)zzx.zzC(paramDataItemAsset.getDataItemKey()));
}
开发者ID:ChiangC,项目名称:FMTech,代码行数:7,代码来源:DataItemAssetParcelable.java
示例8: freeze
import com.google.android.gms.wearable.DataItemAsset; //导入依赖的package包/类
@Override
public DataItemAsset freeze() {
return this;
}
开发者ID:microg,项目名称:android_external_GmsApi,代码行数:5,代码来源:DataItemAssetParcelable.java
示例9: getFdForAsset
import com.google.android.gms.wearable.DataItemAsset; //导入依赖的package包/类
@Override
public PendingResult<GetFdForAssetResult> getFdForAsset(GoogleApiClient client, DataItemAsset asset) {
throw new UnsupportedOperationException();
}
开发者ID:microg,项目名称:android_external_GmsLib,代码行数:5,代码来源:DataApiImpl.java
注:本文中的com.google.android.gms.wearable.DataItemAsset类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论