Android bluetooth, override pairing prompts

霸气de小男生 提交于 2019-12-13 04:40:04

问题


Assume a device has never seen another device before, in this setup it will know of its device mac address already and simply try to pair that device to determine if it is in range now

How can I override the pairing dialogue?


回答1:


I don't think you can override the pairing dialogue.

But I think it is possible to do what you are trying to do. If you initiate a device discovery and register to receive the ACTION_FOUND intent. http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#ACTION_FOUND Note that this intent gives you the name of the discovered devices. The RSSI is available too - you might find that useful.

That way you can determine whether the device you are looking for is in range without pairing (and without a pairing dialogue appearing).



来源:https://stackoverflow.com/questions/9961726/android-bluetooth-override-pairing-prompts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!