Is it possible to create wearable notifications without using the notification builder?
I already create a notification via new Notification on newer devices and would like to keep that code and still add the Wearable notification to my existing one. Is this possible, or is everything connected to the builder helper class for now?
It seems that there is no WearableNotifications.Builder class anymore in the newest SDK.
But you need to do nothing to simply let your Notification show on Android Wear Devices.
If you want to have a slightly better look for your Notifications you can use WearableExtender to add Android Wear specific actions, pages and layout options.
The WearableNotifications.Builder class is only needed if you want to add 'wearable extensions' to your notification. The normal notifications shown by your app are displayed also on the wearable connected to your device without any further integration work.
Related
Is there any way to prevent a notification be shown on Android Wear device? I know it's possible by using setOngoing(true) but I don't want my notification to be ongoing.
you should call setLocalOnly(true) on the NotificationCompat.Builder.
From the documentation
Set whether or not this notification should not bridge to other
devices.
you can read more here
While setting up the VPN connection in android phone, a system level notification with 'key' icon is generated by android system automatically. I am building an App which requires to set up a TUN interface internally but I am afraid of this notification which will be shown in notification bar by android system. I do not want android system to show up this notification to user.
Secondly a warning message "Attention" is also popped up while setting up a VPN connection. Again this message is also generated by android system.
I wanted my app to run quietly without showing any warning message and notification in notification bar. Any idea on how this thing can be achieved ??
Thanks
You cannot remove or disable it without changing the ROM. It is an android feature.
May be you should try something like How to cancel Android notifications or How to properly clear all notification once clicked in two words - something like this:
// Clear all notification
NotificationManager notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancelAll();
}
You can use the Xposed plugin NotifyClean to remove any notification, even the android system notify.
If you want to do it from source, viewing their source code may help.
I'm developing an application where the user can create his own tasks and then he gets a notification when the time comes. So my question is how to push these notifications to his smartwatch? do I really need to code something or just write some wearable features and then synchronize them by using Bluetooth?
You don't need to code anything Android Wear specific. Just use the NotificationCompat.Builder to build your notification on your phone and it will show up on your Android Wear device.
I am using pushwoosh to send notification from server to devices. And that is working without any problems. Also it is worth mentioning that I am using phonegap/cordova. This problem is only related for android, ios does not has this problem.
Problem is when I send few notifications in short time only one is displayed in android notification area. On notification handle in my code all notification are received. Notifications do not have same title or text.
You need to enable multi-notifications for Android. Look for "setMultiNotificationsMode" here:
https://github.com/Pushwoosh/pushwoosh-android-sdk/blob/master/Documentation/PushManager.md#setmultinotificationmode
You need to enable multi-notifications for Android.
PushManager.setMultiNotificationMode(context);
How can I read existing notifications on Android? I want to be able to grab all the pending/existing notifications, parse them, and try to grab any information them. For instance, if my device had notifications from an SMS app, then I want to be able to read whatever information I could (if possible) from the notification. Is this possible?
Note that I am NOT asking for an active notification listener/receiver. I just want to be able to parse existing notifications on-demand.
Thanks in advance!
On devices with Android 4.3 and newer (API level 18) it is possible to use the NotificationListenerService and its function getActiveNotifications() to get a list of all outstanding notifications visible to the user. You can also react on each new notification by using onNotificationPosted.
On older devices, the only way to get access to the android notifications is to implement an AccessibilityService to react on incoming TYPE_NOTIFICATION_STATE_CHANGED-events.