Android notification led, receive an event when it changes its status - android

I need to monitor the status of the notification LED on an android device. I've seen several post that explains how to customize the LED behavior (i.e. Changing LED color for notifications) however I would like to receive an event (using a receiver) whenever the LED changes its status or an app triggers a blink, regardless of which app caused the blink.
Is it possible to receive these event?
If yes, which intent filter should I use to receiver this kind of event?
Thanks!

Is it possible to receive these event?
Definitely not in the Android SDK. A custom Android build packaged as a ROM mod may be able to determine this, at least for OS-triggered uses of the LED. System-level use of the LED (e.g., charging status) may not be visible to Android at all.

Related

Can Android Companion Device Pairing wake up the Companion App from background upon Bluetooth Connection

I want my app to be woken up when the device finds a specified bluetooth device. The problem is, that after android O you can't register a broadcast receiver anymore to handle that in the background. Having a constant foreground service is also no option for me. Android Auto does this behaviour already I am trying to implement myself.
I found this: https://developer.android.com/guide/topics/connectivity/companion-device-pairing
It says
After the device is paired, the device can leverage the REQUEST_COMPANION_RUN_IN_BACKGROUND and REQUEST_COMPANION_USE_DATA_IN_BACKGROUND permissions to start the app from the background.
Sadly i cant seem to find how this is used and if this even provides what im looking for. I am happy for all suggestions and hints.
There's an option to associate a device using CompanionDeviceManager and register a listener CompanionDeviceService via https://developer.android.com/reference/android/companion/CompanionDeviceManager#startObservingDevicePresence(java.lang.String), then you will receive notifications from the system https://developer.android.com/reference/android/companion/CompanionDeviceService#onDeviceAppeared(android.companion.AssociationInfo) and execute your service in the background.

Does Beacon Notification Can wake up terminated app

I have project need to add notifications with Beacons。I have some questions wanna to make sure.
does os can receive beacon notification without APP running?
Can we show different showing content depend on different beacon notification?
can we open terminated app by beacon notification?
can the app do different behavior depend by the beacon notification content after start up?
Thanks。
1- How beacon works
The Android Beacon Library can launch your app into the background to
start looking for beacons after the phone boots. This will happen
transparently with no visible user interface, while the rest of your
app remains idle.
Once the desired beacon is detected, a callback method fires where you
can push a custom notification message. You can further configure the
notification so it launches a specific part of your app when pressed.
2- different notification
Yes ! each beacon has its id and you can handle showing different notification depending on the id and also different content
3- lunching app
Yes ! you can add your logic in the services that handle beacon notification method to start the preferred activity.
WARNING: launching a UI without any user interaction is a very very bad practice for most of the applications!
[...] Interrupting what the user is currently doing is considered bad
design form, especially from something that is supposed to be
operating in the background. Therefore, you should consider using a
Notification [...] to launch the desired Activity when the user
decides it is time to investigate. [...]
4- App behavior
Yes ! all you have to do is setting your pendingIntent accordingly to the notification

What happens when Push Notification is turned off ? Will code be executed (minus UI)?

Customers can turn off push notifications at the app level. When that happens, we all know the the notification tray UI will not show up. But,
Does GCM/FCM (android) and APNS (iOS) continue to deliver notification to the customer's phone regardless ?
Specifically, on android & iOS, will I be able to execute some logic in the push event listener regardless of whether the user turned the push notifications on/off ?
In Android, when we disable push notifications, does the OS automatically unregister the app from GCM/FCM ?
Note:
I am NOT interested in background app refresh on iOS or background refresh through WorkManager on Android. I am NOT interested in iOS silent notifications or other kinds of Background Executions.
My question is specifically whether the code block is invoked (or not) when push notifications are turned off at app level (using the toggle).
I am not sure about the android, but in iOS this thing is possible.
You can do this but just keep in mind, that Background App Refresh is enable in device.
For more details, look into this link
https://www.urbanairship.com/blog/watch-list-ios-8-opt-in-changes
I hope you get your answer from above link

Is it possible to create a Notification which doesn't generate Heads up Notification, but will appear in lock-screen

I am currently in a project which develops a DECT-based android system based on Android 5.0.1, and need to add a mode which will bring up the Dialer App while the InCallUi App is running (when there is an incoming call). When the Dialer App is in the foreground, there will be an annoying headsup notification from the InCallUi App showing the incoming call information displaying on the top of the screen.
I want to ask if there is a way to hide the headsup notification, while in locked-screen the notification entry can still be seen?
I have tried to change the priority of the notification, as indicated in the following link that the headsup notification only presented when the priority is set to HIGH, MAX and FULL_SCREEN: "If a notification's priority is flagged as High, Max, or full-screen, it gets a peeking notification.", but when I set the priority to LOW or MIN the headsup notification still shows:
https://material.google.com/patterns/notifications.html#notifications-behavior
Can anyone help? thanks:)
No, this was a security bridge on older versions of android that provided a way to services to run as ForegroundServices without the user knowing, that issue was fixed in android 4.4.
You can see this SO thread for more information.

Sony Smartwatch 2 manage vibration on receiving notification

I'm using sony addon sdk to develop an notification app on smart watch 2.
I've managed to get everything work (watch vibrates when my phone gets notification),
but I havn't got a way to modify the vibration length.
Is there any way to manage vibration on receiving notification? as in shorter vibration, longer vibration, etc..
The default vibration seem a bit too long, so I want to modify it's length.
Any help would be appreciated.
Short answer: There is no possibility to configure the vibration of the standard notification, using Notification API.
You can only create custom vibration pattern, in your SmartWatch2 extension using Control API. That is available only after user starts Extension, not for the Notification purpose. To start vibration pattern for your running extension, you can use: ControlExtension.startVibrator(int onDuration, int offDuration, int repeats)

Categories

Resources