How can i use the Bluetooth HID Device profile in Android Pie?

前端 未结 3 483
刺人心
刺人心 2021-02-09 02:04

I am trying to write an app for Android P using the Bluetooth HID device profile service to be used as a Bluetooth keyboard. According to the documentation I am supposed to use

3条回答
  •  星月不相逢
    2021-02-09 02:19

    There is a semi-official sample code available here: https://github.com/ginkage/wearmouse — actually by Google itself (see https://opensource.google.com/projects/wearmouse).

    It is intended for using on Wear OS watches, but has everything you need to use it on a phone as well: proxy class for the profile, a callback class, HID Descriptor example, QoS, callbacks for cases like battery level inquiry from the host, etc.

    The app itself is available at Google Play here: https://play.google.com/store/apps/details?id=com.ginkage.wearmouse (the app supports Android 8 as well, by the way, but that only works on watches, not phones).

提交回复
热议问题