Visibility of Android BLE pairing prompt - android

I'm working on Android app that pairs and interacts with BLE accessory. When app initiates pairing with the accessory for the first time one of two things happen:
Either phone shows pairing dialog with the field for PIN code
Phone adds new notification to the statusbar with small BT icon.
User then has to swipe down and tap "Touch to pair with ..." notification that presents the prompt.
What does it depend upon? Is there a way to encourage OS to show dialog instead of the notification?

There is nothing you can do about it. This is totally dependent on the OS (version/variant/manufacturer).

Related

Bluetooth pairing pop up in android is appearing in two dialog screen one is (just pair) and another one is user enter pin

While initiating pairing firstly it will ask pair with device (device name)i.e just pair pop up appears on click of OK button one more pairing pop up appears requires user input (pin)is required to pair. I want a user input pairing pop up dont want just pair pop up we require only one pop up in android device. How do we archive in android devices? Please suggest.
I observed in IOS devices we are receiving only one pairing pop up dialog i.e ( user to enter pin) but in android devices we are receiving 2 pop up dialog. Please let me know the root cause.
I am using Xamarin forms to run on android & IOS . I tried to initiate the pairing by reading characteristic and receiving two pairing pop up. in IOS it is only one.

android app interact with system bluetooth pairing dialog

I am researching my first attempt to write an android app. I basically just need a "dumb" app that runs on the device and looks for the Bluetooth pairing pop-up request and selects the "Pair" option.
I have found a lot of examples of this when the application I'd be writing is the one instantiating the pairing, but in this case, it's not - it's more of an "out-of-band" scenario. A device will initiate a pairing request with the phone & and app this "dumb" app would be running on. All I want to do is have this app detect when that happens and accept the pairing requests so I don't have to constantly do this manually.
I know there are automation frameworks that can do this, but that is such overkill for a what seems to be a simple task - just sit there and every # seconds (maybe 15) do a quick check for the pairing pop-up dialog and press pair
Is this possible?

Android 5.0+ hides "Bluetooth pairing request" from user in notification area

I see this very confusing issue on GPE devices (Nexus, Moto G) with Android 5.0+ (still exists in Moto G with 5.1).
I`m working on android application that connects to a custom board via Bluetooth (RFCOMM). When I initiate connection Android frequently shows "Bluetooth pairing request" dialog and ask user click "pair" button. It is normal behaviour.
But with Google Play Edition devices like Nexus(5,6,9) and Moto G(may be with other GPE devices too). This messages do not appears to user. Instead android hides it in notification area. As result users do not understand that some user actions required. From user prospective app hangs up.
This dialog is not a part of the application. With Samsung Galaxy devices I do not see this issues.
Is there any workaround to show this dialog on top always?
I can think about two options:
You could start an Intent that would bypass the lock screen (if there is one) and display a msg to the user that an action is required (Android Lollipop - Bypass lock screen for popup activity).
You could add your own notification with a beep (using the MediaManager) and vibration to make sure the user is aware that he needs to approve the pairing. bear in mind that the user can configure the phone not to display notifications on any device running Android 5.x (in settings->sound and notifications) so It's won't always solve your problem.
Good luck!

Show default Bluetooth pairing request dialog

I am really struggling with this problem and I cannot find a way to do it. I need to show the default dialogs from Android when pairing with a Bluetooth device.
Right now I achieved to pair them programmatically with a quite easy method but it only works from API 19. And I need this to be done from API 18.
Right now, when I connect to a device in my app I get the notification asking to pair a device, but it doesn't show the dialog to do so. If I want it, I have to expand the notifications in the device and click in the pair request notification.
Is there any method which I could call, for example when I receive the notification in my broadcast receiver, to show me the default pairing request dialog? And after the user accepts the pairing and inputs the PIN just do the process to pair, dismiss it and keep using the app?
Your help would be much appreciated!

<Android> Bluetooth Pairing Confirmation notification

We are developing an android application which connects to Bluetooth device using secure simple pairing. As expected, We observed that when ever the application connects to Bluetooth device using the android provided API's, a pairing confirmation dialog is generated for user confirmation.
On Nexus4, we observed that pairing notification is generated sometimes and the user needs to select the pairing notification to confirm pairing. Looking into the source code of Setting Application, specifically(BluetoothPairingRequest.java), there is a check for screen on/off to decide whether to generate a pairing dialog or notification. In our case, the screen is on, but it still generates a notification. Can someone please provide information on how this usecase(pairing notification) can be avoided.
Thanks in advance.
-Ashwin

Categories

Resources