Building watch faces
Android wearables are far more than just watches, but they still need to perform the basic task of presenting the user with the current time.
Getting ready
Although, automatically installed when creating a new Android Wear project, we do need to have the Xamarin.Android.Wear NuGet installed in the wearable project.
How to do it...
Creating a watch face consists of creating two parts. The first is the rendering engine, which inherits from one of the WatchFaceService.Engine
types, and the other is WatchFaceService
, which manages it:
- We need to specify the permissions for both the handheld and wearable apps. The handheld does not require any activities, but just requires the permissions to be set:
[assembly: UsesPermission(Manifest.Permission.WakeLock)] ...
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.