Show default bluetooth request dialog

I am really struggling with this problem and I cannot find a way to do this. I need to show the default dialogs from Android when paired with a Bluetooth device.

Currently, I have achieved their software development using a fairly simple method, but it only works with API 19. And I need this to be done from API 18.

Right now, when I connect to the device in my application, I get a notification asking me to connect the device, but it does not display a dialog box for this. If I want, I have to expand the notifications on the device and click on the pair request notification.

Is there any method that I could call, for example, when I receive a notification in my broadcast receiver to show me the default request dialog? And after the user agrees to pairing and enters the PIN code, just follow the process to pair, release it and continue to use the application?

Your help will be greatly appreciated! Thanks in advance!

+6
source share

Source: https://habr.com/ru/post/973482/


All Articles