O'Reilly logo

Xamarin Mobile Development for Android Cookbook by Matthew Leibowitz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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)] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required