Introducing wearable notifications

Wearable devices are very useful for apps as they allow users to read notifications without having to reach for a handheld.

Getting ready

To make use of notifications on a wearable, we need to have the Android Support Library v4 Component or the Xamarin.Android.Support.v4 NuGet installed on our handheld project.

How to do it...

We can make notifications automatically appear on a wearable if we manage our app's notifications using the NotificationCompat type:

  1. To display typical notifications on a wearable, we will build and display them using the NotificationCompat and NotificationManagerCompat types:
    var notification = new NotificationCompat.Builder(this) .SetSmallIcon(Android.Resource.Drawable.StatSysDownload) .SetContentTitle("Wearable ...

Get Xamarin Mobile Development for Android Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.