当前位置: 首页>>代码示例>>Java>>正文


Java MessageEventParcelable类代码示例

本文整理汇总了Java中com.google.android.gms.wearable.internal.MessageEventParcelable的典型用法代码示例。如果您正苦于以下问题:Java MessageEventParcelable类的具体用法?Java MessageEventParcelable怎么用?Java MessageEventParcelable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MessageEventParcelable类属于com.google.android.gms.wearable.internal包,在下文中一共展示了MessageEventParcelable类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onRpcRequest

import com.google.android.gms.wearable.internal.MessageEventParcelable; //导入依赖的package包/类
@Override
public void onRpcRequest(Request rpcRequest) {
    Log.d(TAG, "onRpcRequest: " + rpcRequest);
    if (TextUtils.isEmpty(rpcRequest.targetNodeId) || rpcRequest.targetNodeId.equals(wearable.getLocalNodeId())) {
        MessageEventParcelable messageEvent = new MessageEventParcelable();
        messageEvent.data = rpcRequest.rawData != null ? rpcRequest.rawData.toByteArray() : null;
        messageEvent.path = rpcRequest.path;
        messageEvent.requestId = rpcRequest.requestId + 31 * (rpcRequest.generation + 527);
        messageEvent.sourceNodeId = TextUtils.isEmpty(rpcRequest.sourceNodeId) ? peerNodeId : rpcRequest.sourceNodeId;

        wearable.sendMessageReceived(rpcRequest.packageName, messageEvent);
    } else if (rpcRequest.targetNodeId.equals(peerNodeId)) {
        // Drop it
    } else {
        // TODO: find next hop
    }
    try {
        getConnection().writeMessage(new RootMessage.Builder().heartbeat(new Heartbeat()).build());
    } catch (IOException e) {
        onDisconnected();
    }
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:23,代码来源:MessageHandler.java

示例2: zza

import com.google.android.gms.wearable.internal.MessageEventParcelable; //导入依赖的package包/类
public final void zza(final MessageEventParcelable paramMessageEventParcelable)
{
  zzb(new Runnable()
  {
    public final void run() {}
  }, "onMessageReceived", paramMessageEventParcelable);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:8,代码来源:WearableListenerService.java

示例3: onMessageReceived

import com.google.android.gms.wearable.internal.MessageEventParcelable; //导入依赖的package包/类
@Override
public void onMessageReceived(final MessageEventParcelable messageEvent) throws RemoteException {
    post(new Runnable() {
        @Override
        public void run() {
            WearableListenerService.this.onMessageReceived(messageEvent);
        }
    });
}
 
开发者ID:microg,项目名称:android_external_GmsLib,代码行数:10,代码来源:WearableListenerService.java

示例4: sendMessageReceived

import com.google.android.gms.wearable.internal.MessageEventParcelable; //导入依赖的package包/类
public void sendMessageReceived(String packageName, MessageEventParcelable messageEvent) {
    Log.d(TAG, "onMessageReceived: " + messageEvent);
    try {
        getListener(packageName, "com.google.android.gms.wearable.MESSAGE_RECEIVED", Uri.parse("wear://" + getLocalNodeId() + "/" + messageEvent.getPath()))
                .onMessageReceived(messageEvent);
    } catch (RemoteException e) {
        Log.w(TAG, e);
    }
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:10,代码来源:WearableImpl.java


注:本文中的com.google.android.gms.wearable.internal.MessageEventParcelable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。