Home Development for Android Designing watch faces for Android Wear is easier than it looks

Designing watch faces for Android Wear is easier than it looks

by admin

When the idea of making watch faces for Android Wear arose, we got down to business without fear. There was experience in developing for "big" android, and the watch has a tiny screen and only one button – easy.
Designing watch faces for Android Wear is easier than it looks
As always, instructions from the developers at developer.android.com/training/building-wearables.html were left out – we should have been creating, not reading manuals. That’s why a lot of things you can learn from there became insights and your own "breakthroughs".
The application consists of two parts : mobile and wear that Android Studio kindly generates when you create a new project. The revelation was that wear is compiled, packaged and invested in the raw resources of mobile. Mobile, on the other hand, is a standard phone application which, when installed, is deployed and sends the wear from its package to the watch. Forwarding and downloading is done by Android Wear, a bridge application that connects wearable gadgets to the "big brother" (downloaded from Google Play to unlock the full potential of the watch). By the way, Motorola offers on the follow-up to install its own application, which is like Android Wear, only Moto Connect:) Of the pluses – its own, Motorola’s advertising applications that appealed to them personally, and of course their own fitness gimmicks.
It was decided not to saw a bicycle, but to take advantage of the latest advances in engineering, building the application on the SDK from the professionals who had a hand in the origins of the platform (quote from the website): github.com/ustwo/clockwise
Subsequently, when the platform became more native, it turned out that the guys wrote a not very thick layer over the native WatchFaceService, thereby leaving complete freedom for creativity and saving a day or two for writing the same basic service. Thanks anyway: the platform allows you to configure style elements of the future watch, update frequency, pulls functionality of working with dates and delegates onDraw and onLayout methods. In addition, it tells the shape of the clock, but only in two variants – round/square. Motorola with its "beard" (aka "chin" or "flat tire") is defined as round, but with a width greater than height, so we calculate it.
Designing watch faces for Android Wear is easier than it looks
The nifty built-in on24HourFormatChanged method that we had was not called when the format was changed when the dial was active. The only call occurred at startup. We had to monitor the format every time the screen updated.
Since we had a designer on the team, we decided that the dials would be rendered as images. No logic, no canvas drawing, only PNG, only hardcore. So, we created image libraries for the numbers and positioned ImageView, where the needed numbers were put according to HH:mm in 24 or 12-hour format depending on the user’s locale.
Next, following the tastes and preferences of users, there was a need to display the date. The 6 ImageView dd.MM.yy, or MM.dd if the owner of the watch is from the USA, appeared for this purpose.
The most frequent rebuke we received from Google Play at the time was the lack of ambient mode We didn’t implement it consciously, because its existence was mentioned in the manual, but with almost no pictures and far from the beginning.
According to a good idea of the creators of the platform, the clock after a few seconds of inactivity goes into battery saving mode, sending the service, which draws the dial, a corresponding notice. The dial should respond to the new state, completely simplifying the interface. Instead of a colorful drawing with lots of whistles, the screen should be filled with 95% black, leaving only dim numbers. Further, the quality of the image depends on the watch manufacturer: someone displays grayscale images in black and someone displays the image in b/w. Also in this mode it is prescribed to disable all power-consuming functions of your application – no geolocation or youtube browsing.
Designing watch faces for Android Wear is easier than it looks
The last step was the functionality to display information about the battery level of the phone and the clock. Communication with the phone takes place through the Google messaging layer, so this seemingly insignificant amount of information required the implementation of an additional service, which became the cornerstone of the messaging infrastructure between the phone and the watch.
P.S. And a tip for those not in the know. To get rid of the annoying "Ok Google" prompt on the watch screen, you need to say this very "spell" 2-3 times. Voila, nothing else is a nuisance!
Designing watch faces for Android Wear is easier than it looks

You may also like