Search code examples
androidbluetoothpairing

Bluetooth Pairing Without users' confirmation


Can I pair smartphone over Bluetooth without a need to confirm this in user interface, accept to pair this devices. I use android studio. I don't need to exchange data over them, I need just pairing without any action. And then safely pair with smartphone over Bluetooth without any user's action?


Solution

  • Yes and no, but you shouldn't anyway.

    The only way to do this in Android is by using the BLUETOOTH_PRIVILEGED permission, which, as you can see, is only granted to apps in /system/priv-app/ or apps signed by the platform key of the device.

    So unless you have root and can move your app to /system/priv-app/, you can't do what you want. Even if you can do this, however, don't. It's not a good user experience when someone installs an app, only for it to move itself to the system partition and start pairing without any notification.