NodeApi是否特定于Android Wear? [英] Is NodeApi specific to Android Wear?

查看:100
本文介绍了NodeApi是否特定于Android Wear?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用中检测已连接的Android Wear设备。我在此处找到解决方案使用 NodeApi 。但是文档并没有说明有关Android Wear的特定信息:

I want to detect the connected Android Wear device in my app. I found the solution here using NodeApi. But the documentation doesn't say anything about that is it specific to Android Wear or not:


公开了一个用于了解本地或本地的API

Exposes an API for to learn about local or connected Nodes.

节点事件传递到设备上的所有应用程序。

Node events are delivered to all applications on a device.

这里的节点是什么?是通过蓝牙连接的任何设备,还是通过蓝牙连接的特定Android Wear设备?我想检测连接的设备是否为Android Wear设备并获取其显示名称。

What is a Node here? Is it any device that connected over bluetooth or specific Android Wear device connected over bluetooth? I want to detect if the device connected is Android Wear device and get its display name. Any reference about this?

推荐答案

NodeApi适用于Android Wear,但它是可在设备端使用的API

The NodeApi is for Android Wear, but it is an API that can be used on the device side.

NodeApi.GetConnectedNodesResult nodes = 
    Wearable.NodeApi.getConnectedNodes( mApiClient ).await();

然后对于节点中的每个节点,您可以调用 getDisplayName()

Then for each node within nodes, you can call getDisplayName().

这篇关于NodeApi是否特定于Android Wear?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆