Google’s Complication API enables developers to find quick solutions for IoT

Page 1

Google’s Complication API enables developers to find quick solutions for IoT

Image source: Cloudwards.net

Google’s Complication API enables developers to find quick solutions for IoT Users wants both beauty and utility when it comes to watch faces of their smart wrist watches. They want bite size information combined with the style they love. If you have an app, adding a complication data provider offers a simple way of engaging with users on Wear OS. Wearable smart tech begins with watches and is considered a big market segment when it comes to Internet of Things Solutions. Success means that you now own a piece of the screen real estate that the user wears all day. One of the cool UI feature of the Wear OS by Google is the watch face. Users can choose from those shipped to their devices, or from third party developers. This provides style, but as a IoT app development company you might wonder about the utility of the device. In user’s research, it was found that users liked to access bite size information from their watch face. This can range from date to the current temperature, this is called “complications”, a term used by traditional watchmaking. One way for this to be done is for each watch face to make their own business stills and bespoke integration with all the app data sources that the user can possibly want. Clearly this is not a scalable solution. As a result, Google created Complications API to connect watch faces with all the data sources in the watch. There is no need for business


and data format agreements. They all pass the data according to an agreed format. With the complications API users can choose the watch face that expresses their style and the data they find the most useful. If you have mobile application think about the one piece of data that the user would like to know and focus on that. The next step is to see how that data can be expressed in different types. With Wear OS, Google provides a large variety of choices from short text to large image. Try to support as many types as you reasonably can. This will ensure the wider support from watch faces. Now that you have decided what data items to show and how they should be expresses, it’s time to code. To get started. You can follow the step-by-step code lab available online.

Read More-Impact of Internet of Things on App Development At it’s core. A complication data provider is a service that extends complication provider service. Once your user has selected the complication data source, Wear OS will bind to the service and request data when it is needed. There are three methods to easily achieve this: First is the onComplicationUpdate method. This is called every time the system requests complication data. Since the same data provider can supply multiple data types, pay attention to which type of data is requested before returning. The second and third methods are a pair (onComplicationActivated /onComplicationDeactivated). These are called when a watch starts or stops displaying data from your complication. If there is data being stored for an instance of a complication, it can be set up in activated and cleared in deactivated. In addition to the complication provider service, two metadata tags in the Android manifest are worth highlighting. The first tells the system which complication data types your provider supports. The second tells the system how often the complication should be refreshed. There are two things to note here, starting with the fact that although the attribute is called UPDATE_PERIOD_SECOND, think of this period in minutes, and the longer the better. This is for battery conservation. Second, if you service receives updates via push, you can set the update to trigger at irregular periods by setting this attribute to zero, and instead trigger updates using provider update requester. You can find full details of how this is done in the code lab. If you are a team of mobile app developers, creating a complication data provider is one of the simplest and meaningful ways you can support your users on Wear OS.


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.