Reputation: 1955
I'm writing an App that allows its users to automatically exchange data with other nearby users over BlueTooth. Normally, the two users would have to manually pair with each other before this could happen.
I was wondering if there was a way to bypass this step and automatically discover and connect to nearby users of my app, perhaps using some kind of app id signature for security?
Thank you!
Upvotes: 1
Views: 363
Reputation: 17864
I see from your comment that you have already discovered the solution to the 'connect' part of your question: the API's for creating an insecure connection without manual pairing.
But that still leaves discovery. In order to create a connection you need the Bluetooth address (bd addr) of the target. To do this, you will need to get one user's phone into discoverable mode, and then do a discovery on the other phone. This can't be done silently - your app can invoke these modes, but this will cause the phone to prompt the user. No so bad, but probably not as automatic as you want.
If the two phones are on the same network, they could exchange bd_addr over the network - eliminating the need for discovery. Or this could happen with a server as an intermediary, but this is a lot more work if you don't already plan to have a server.
Upvotes: 2