Android Wear断开通知 [英] Android Wear disconnection notification

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

问题描述

我有一个Android Wear应用程序,它传达加速度值到手持设备的应用程序。

I have an Android Wear app which communicates accelerometer values to an Handheld app.

我要在手持设备的应用程序时得到通知与Android Wear应用连接刚刚丢失(当Android Wear应用是封闭的,例如)。

I want to be notified in the Handheld app when connection with the android wear app has just been lost (when the Android Wear app is closed, for instance).

我该怎么实现的?

感谢您的帮助。

推荐答案

连接磨损到设备网络中的设备称为节点。您可以使用节点API来确定设备何时进入或离开网络(例如,当磨损设备成为从手机断开)。

Devices connected in the wear-to-device network are called Nodes. You can use the Node API to determine when devices enter or leave the network (e.g. when a wear device becomes disconnected from a phone).

<一个href=\"https://developers.google.com/android/reference/com/google/android/gms/wearable/NodeApi.NodeListener\" rel=\"nofollow\">https://developers.google.com/android/reference/com/google/android/gms/wearable/NodeApi.NodeListener

您也可以使用节点API来获取所有连接的设备列表(例如全部扣上连接到电话设备)在任何给定时间

You can also use the Node API to get a list of all connected devices (e.g all wear devices connected to a phone) at any given time

https://developers.google.com/android/reference/com/google/android/gms/wearable/NodeApi

这篇关于Android Wear断开通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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