开发者

New Bluetooth API question

开发者 https://www.devze.com 2022-12-22 18:29 出处:网络
I have written a small app that puts my bluetooth in discoverable mode for a long time (G1 - API 1.6). I use that along with small program on windows to lock/unlock th开发者_JAVA百科e computer if the

I have written a small app that puts my bluetooth in discoverable mode for a long time (G1 - API 1.6). I use that along with small program on windows to lock/unlock th开发者_JAVA百科e computer if the phone is close by. Recently i try to port this app to my nexus one but it seems like i have to pop up the message every 300s to enable device to go to discoverable mode. does anyone know how i can suppress that?

I'm ok with saying ok for the first time but not every 300s :)


Instead of discovering the phone, wouldn't it be more secure to pair the phone and the computer which would then let you search for it without the phone even being discoverable?


I was wondering if you could possibly just listen for ACTION_SCAN_MODE_CHANGED for a change in the scan mode and then reset it if needed.

If that isn't what you are looking for, maybe there is some way to manipulate the bluetooth stack directly, however I am not too sure about that to tell you the truth. The first option above should do the trick (almost) seamlessly.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号