Find already paired bluetooth devices automatically, when they are in range

后端 未结 2 1522
有刺的猬
有刺的猬 2020-12-28 18:14

I am no Bluetooth specialist and wondering what possibilities are available to find already paired Bluetooth devices automatically when they are range of each other.

<
相关标签:
2条回答
  • 2020-12-28 18:40

    After connecting the device for the first time, keep the mac address in a local list. On disconnect, use connectGatt with autoconnect set to true to automatically re-connect when you are in range.

    0 讨论(0)
  • 2020-12-28 18:44

    Not a full solution, but maybe it's sufficient for your app to poll the accesory's presence whenever the screen is turned on? In that case, this may be helpful: Start Activity on wake up/sleep in Android

    0 讨论(0)
提交回复
热议问题