I am using some home replacement that allow me to hide the notification Bar and that's something I really like.
All the informations can be replaced by some widgets, but I would like to display the notifications too.
As I already developed some applications, I would like to know if there is a command line that allow an application to get all the notifications. I plan to add this to a widget or a toast.
Thank a lot for any clue or help.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.
You need to grant access to your app to read notifications: "Settings > Security > Notification access" and check your app. Show activity on this post. Inside the NotificationListenerService you need a looper to communicate with GUI thread so you can create a broadcast to handle the GUI interaction.
Since Android API Level 18 (Android 4.3) there is a class NotificationListenerService. You must set the Permission BIND_NOTIFICATION_LISTENER_SERVICE and use a intent-filter with the action NotificationListenerService.
<service android:name=".NotificationListener"
android:label="@string/service_name"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>
Source: http://developer.android.com/reference/android/service/notification/NotificationListenerService.html#getActiveNotifications()
I will answer my question because I found something on an other forum.
Seem that you can access them declaring your application as an (sorry for the french term, I couldn't find an english translation) "gestionnaire d'accessibilité" that you may translate as "accessibility manager"
More information here: https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html
That may be dangerous and has a lot of negative point, but an other dev that is also working on a custom Home assure me that this feature work and he was able to create his own notification bar.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With