Creating dynamic always-on wearable apps

An always-on app provides the user with the ability to view information at any time, without having to wake the device; however, the visible information may become stale if the actual information changes more frequently than once in a minute.

How to do it...

We may need to update the content on the wearable more frequently than once in a minute; thus, we can schedule an alarm to trigger an update outside the one-minute interval:

  1. We will need the wake lock permission on both, the handheld and wearable:
    [assembly: UsesPermission(Manifest.Permission.WakeLock)]
  2. If we want to support older wearables, we will need to set the wearable library as optional:
    [assembly: UsesLibrary( "com.google.android.wearable", false)] ...

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.