本文整理汇总了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();
}
}
示例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);
}
示例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);
}
});
}
示例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);
}
}