Google has rolled out its new Awareness API for developers, allowing them to adapt the way apps behave in response to users' actions and environments.
Announced last month at Google's developer conference, the Awareness toolset will enable apps to guess what a user is doing based on a combination of seven context signals from an Android device including time, location, place type, activity, beacons, headphones, and weather.
Google rolled out the two Awareness APIs for all Android developers on Monday in an update through Google Play services.
The Snapshot API lets apps request information about the user's current context, while the Fence API lets apps react to changes in the user's context.
Using the APIs, a music app, for example, could suggest a particular song if it detects that the user has plugged in the earphones and is walking.
The features work even when the app is not active, to help developers to enable their apps to anticipate what users want.
While Google hopes the tools allow developers to "delight and engage" their users, it also advised developers against pestering users with too many notifications, or being too aggressive with actions, such as launching immediately when a condition is met.
Also, while the Awareness API is designed to be efficient, developers can still cause battery drain through certain types of usage, such as making too many requests to see what the user's current activity is.
Google lists two apps that are making use of the new APIs. House-hunting app Trulia is using the Fence API to detect good weather. If the user is walking near a house they've shown interest in, Trulia will send a notification reminding the user to stop by. The SuperPlayer Music app is using both Awareness APIs to understand the current activity and recommend a suitable playlist.