Android Things Awareness API gets updates

Android Things, Google’s setup for Internet of Things (IoT) has added semantic time support to the API to give developers a “higher degree of flexibility”, and more ways to convey time.

Last year, it was at the I/O that Android Things had launched the Awareness API, allowing developers to use signals such as Location, Weather, Time and User Activity to build contextually relevant app experiences. It’s available via Google Play services.

The Awareness API offers two ways to take advantage of context signals within your app. The Snapshot API lets your app request information about the user’s current context, while the Fence API lets your app react to changes in user’s context, and when it matches a certain set of conditions. For example, “tell me whenever the user is walking and their headphone is plugged in”.

According to a post on its official blog, developers so far could specify a time fence on the Awareness APIs but were restricted to using absolute/canonical representation of time. Based on developer feedback, the Android Things realised that the flexibility of the API in regards to building time fences did not support higher level abstractions people use when they think and talk about time. “This weekend“, “on the next holiday“, “after sunset“, are all very common and colloquial ways of expressing time. That’s why the company had decided to go ahead and add Semantic time support to these APIs.

Image Credit: Android Things
Click here to opt out of Google Analytics