Awareness API Updated To Support Semantic Time

June 18, 2017 - Written By Mark Real

Google has announced major improvements to the Awareness API that allows it to understand semantic time instructions. Semantic time refers to time signals depicted by common, colloquial but relatively abstract terms like this weekend, sunrise, or sunset. Previously, the Awareness API could only support an absolute representation of time, like midnight or 6:00 PM. This limitation of the API prevents developers from adding app features that better support linguistic or colloquial description of time. However, the developers working on the Android operating system said that they had added support for the semantic time in the Awareness API, making the said API more useful for the developers.

The Awareness API is divided into two component APIs, the Snapshot and the Fence APIs. The Snapshot API gathers details about the user’s current environment while the Fence API works on the information provided by the Snapshot API by sending signals to an application once certain predetermined conditions are met. Once the application receives the signal from the Fence API,  it will then activate certain features even if the app is in the background. Now, the Snapshot API allows applications to request information about the user’s location and time, which together could help the application understand semantic time instructions. For example, once the user request that the night mode for a certain app is activated immediately after sunset, the application could then ask the Snapshot API to retrieve information about sunset times at the user’s current location. After the specific sunset and sunrise times have been retrieved, the Fence API can now identify the conditions necessary to trigger the night mode function of the application.

Fitness applications could definitely benefit from the improvements made to the Awareness API. For example, fitness applications can remind users to either start their workout at a certain time on a specific set of days or set activities during the public holidays. Identifying public holidays is a good example of how the improved Awareness API can be useful since this information is tailored to the user’s current time and location. Aside from fitness applications, surely more applications will take advantage of the improvements in the Awareness API, resulting in an improved experience for the app users.