I'm a bit confused by the documentation for wearable notifications.
If I have an existing app that is using Notification.Builder and NotificationManager.notify() will the notifications automatically also display on a paired wearable or does the app need to change to use NotificationCompat.Builder and NotificationManagerCompat.notify()?
If its not necessary to use the XXXCompat classes for notifications to appear on the wearable then is there any benefit/use in using them instead of the non Compat variants?
NotificationManagerCompat
is required for all Wear specific functionality (anything added via a WearableExtender
, a part of NotificationCompat.Builder
) per delivering notifications:
If you use the framework's NotificationManager, some features from NotificationCompat.WearableExtender do not work, so make sure to use NotificationCompat.
However, basic notifications sent via NotificationManager
will indeed be mirrored over the Android Wear devices without issues.
As CommonsWare alluded to in his comment, it is much, much easier to write Notifications that look good on all API versions by using NotificationCompat
. This will become even more important when Android L comes out (where there are numerous Android L notification changes) which, unless you are targeting Android L+ devices only, you'll need to use NotificationCompat to access.
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