如何在Android中获取蓝牙耳机电池状态 [英] How to get Bluetooth Headset battery status in android

查看:957
本文介绍了如何在Android中获取蓝牙耳机电池状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以获取android中蓝牙耳机的电池电量百分比吗?

Is there any way to get the battery percentage of the bluetooth headset in android ?

请帮助我.

谢谢.

推荐答案

我不确定是否有标准化的方法或是否可能.您有谷歌搜索了吗?如果找到了,您找到了什么?我会自己提供一些链接,因为它们可能会导致某些问题:

I'm not sure if there's a standardized way of doing this or if it's possible at all. Have you Googled a bit and if so what did you find? I'm gonna offer a few links myself as they might lead to something:

  • First of all I'd look into the android.bluetooth.BluetoothHeadset class. It will list connected headsets as generic BluetoothDevices. From there it seems like you can issue vendor specific commands to get different kinds of sensor information (like battery level).

检查此博客帖子,内容涉及从Android访问Plantronics耳机传感器.甚至还有一个带有源代码的示例应用程序.

Check this blog post from a Plantronics employee regarding Plantronics headset sensor access from Android. There's even an example app with source code.

检查 Sony附加SDK 用于使用其SmartApp系统与某些类型的耳机接口

Check the Sony Add-On SDK for interfacing with certain kind of headsets using their SmartApp system

这篇关于如何在Android中获取蓝牙耳机电池状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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