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!
Related
In android there is an option to "Hide silent notifications in status bar". It is in Android settings >> Notifications
If the user has that option activated, my app is not able to display notifications (beacuse my app only displays silent notification), and of course the user blames my app for "not working". Is there a way to detect that situation and warn the user to toggle it?
Let me attach a screenshot of that option. I used the Android Emulator using Android release 12-S.
I cannot find that option in my Xiaomi device using Android 13.
I founded it in an OPPO device running Android 13 but in a different place. In this case it was under each specific notification settings and it was activated by default (really annoying!). See screenshot for the Oppo device:
Any idea how to know how that value is set by code? At least in the standard Android?
So I am using the notifications access to know when certain apps are open and such, which works fine on Android O, but the problem I am having is that some devices apparently do not have access to this feature, so it displays this message.
This feature is not available on this device
Is there a way to know if the phone even has this feature available or not programmatically?
EDIT:
This is the code I currently use to send the user to the notification screen so they can enable access for my app, but as above, some devices like Moto E5 the phone itself does not allow this feature.
startActivity(new Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS));
Summary of my problem: some phones have a pairing requirement where the user has to click on "pair" from a dialogue box. However, some of those manufacturers make that request a notification so it doesn't "block" the user I guess?
A more in depth description of my problem: Let me preface by saying that some phones don't have this problem ( I.e: Samsung s6, note 4, s7, Galaxy A9 were tried and don't require the "pair" dialogue box - those phones ran Android 6 and 7).
When my pairing process is done, I get the ACL_CONNECTED, then I get the dialogue box that will pop up on certain phones ( LG g6 running android 8.0). However, on other phones such as the Pixel 1 ( running Android 8.1), and Moto G, the pairing request appeared as a notification on the top. When that notification would appear, I would get an error on my Bluetooth device ( Error 10, but that error is only a reference for the device , which means "Pairing has not completed completely").
My question: would there be anyway to stop my application to wait for a user to click on the pair button? I.e: put sleep, a timer ( which I tried but it still seems to fail...) , maybe even by pass that requirement by some phone manufacturer? Or, get a handle on that dialogue to force it to open up? I'm not too sure what to do about this bluetooth issue.
I'm developing an app that interfaces with BLE devices using this plugin.
Inside the app, I can pair the devices and monitor their status.
If I close the app I want to disconnect the devices from the smartphone, and when I open it again, I want the app to reconnect automatically to known devices.
Everything works fine without using the background plugin, but I need to use it since the app needs to monitor the BLE devices even when it's in the background.
The problem happens ONLY if I use the background plugin: if I open again the app, the known devices are not reconnected INSIDE the app, but it appears they are already/still connected to the smartphone from the previous time (even if not shown in the Bluetooth devices in the phone settings).
It seems that the Bluetooth connection to known devices isn't really being closed when I kill the app.
It appears like the device is still connected as therefore it doesn't show up when I scan in the app.
I can't reconnect until I close the app, switch off and then on again Bluetooth, and reopen the app.
The steps are very simples:
I open and connect the first time from the phone to the BLE product
Communication is OK, data is sent and received
I close (kill) the application from the smartphone (Without turning off Bluetooth/BLE from smartphone)
I relaunch the application ---> Known device is not reconnected but appears to be somehow still paired with the phone (if I press the pairing button it does not go into pairing mode, that happens if it is already bonded to a phone).
Why this behavior? Looks like something in the background plugin prevents the Bluetooth connection to be closed on app closing. I specify that:
it only occurs using the background plugin, without it activated everything works ok
this behavior occurs only with Android (don't use the background plugin for iOS)
it does happen only on some Android smartphones: tried three different phones, with Android version v4.4, v5.1.1, and v6.0.1, and only two of them show this issue (android version 4.4 on S3 and 6.0.1 on S5 Neo).
Thanks
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).