Main entry point for the Awareness Snapshot API.
| Task<BeaconStateResponse> |
getBeaconState(Collection<BeaconState.TypeFilter>
beaconTypes)
Gets the current information about nearby beacons.
|
| Task<BeaconStateResponse> | |
| Task<DetectedActivityResponse> |
getDetectedActivity()
Gets the user's current activity (e.g., running, walking, biking, driving,
etc.).
|
| Task<HeadphoneStateResponse> |
getHeadphoneState()
Reports whether headphones are plugged into the device.
|
| Task<LocationResponse> |
getLocation()
Gets the device's current location (lat/lng).
|
| Task<PlacesResponse> |
getPlaces()
This method is deprecated. This method is deprecated as of August 07, 2019,
and will be turned off by October 30, 2019. Continued use of these signals is
restricted to customers with existing implementations, through October 30,
2019. New implementations must use the Places SDK for Android instead
of the Places contextual signal.
|
| Task<TimeIntervalsResponse> |
getTimeIntervals()
Gets the semantic time intervals for the to the current time and location.
|
| Task<WeatherResponse> |
getWeather()
This method is deprecated. This method is deprecated as of August 07, 2019,
and will be turned off on January 31, 2020. Google does not offer alternate
functionality for the Weather contextual signal.
|
Gets the current information about nearby beacons. Note that beacon snapshots are
only available on devices running API level 18 or higher. If calling from a device
running API level 17 or earlier, the Task will fail
and calling
getStatusCode() will return status code
API_NOT_AVAILABLE.
To use this method, your app must declare the
android.permission.ACCESS_FINE_LOCATION permission in AndroidManifest.xml,
and the user must provide consent at runtime.
| beaconTypes | The types of beacon attachments to return. See Beacons for details about beacon attachments. |
|---|
Task with
BeaconStateResponse. Use isSuccessful()
to determine success or failure. If successful, use
getBeaconState() to get data on the nearby beacons.| SecurityException | Thrown if a required permission is missing. |
|---|
Gets the current information about nearby beacons. Note that beacon snapshots are
only available on API level 18 or higher. If calling from a device prior to API level
18, the Task will fail
and calling
getStatusCode() will return status code
API_NOT_AVAILABLE.
To use this method, your app must declare the
android.permission.ACCESS_FINE_LOCATION permission in AndroidManifest.xml,
and the user must provide consent at runtime.
| beaconTypes | The types of beacon attachments to return. See Beacons for details about beacon attachments. |
|---|
Task with
BeaconStateResponse. Use isSuccessful()
to determine success or failure. If successful, use
getBeaconState() to get data on the nearby beacons.| SecurityException | Thrown if a required permission is missing. |
|---|
Gets the user's current activity (e.g., running, walking, biking, driving, etc.).
To use this method, your app must declare the
com.google.android.gms.permission.ACTIVITY_RECOGNITION permission in
AndroidManifest.xml, and the user must provide consent at runtime.
Task with
DetectedActivityResponse. Use isSuccessful()
to determine success or failure. If successful, then use
getActivityRecognitionResult() to get the current activity.| SecurityException | Thrown if a required permission is missing. |
|---|
Reports whether headphones are plugged into the device.
Task with
HeadphoneStateResponse. Use isSuccessful()
to determine success or failure. If successful, use
getHeadphoneState() to get the current headphone state.Gets the device's current location (lat/lng).
To use this method, your app must declare the
android.permission.ACCESS_FINE_LOCATION permission in
AndroidManifest.xml, and the user must provide consent at runtime.
Task with
LocationResponse.
Use isSuccessful()
to determine success or failure. If successful, then use
getLocation() to get the current device location.| SecurityException | Thrown if a required permission is missing. |
|---|
This method is deprecated.
This method is deprecated as of August 07, 2019, and will be turned off by October 30,
2019. Continued use of these signals is restricted to customers with existing
implementations, through October 30, 2019. New implementations must use the Places SDK for Android instead of the
Places contextual signal.
Gets the device's current semantic location, or "place", which can include a name, place type, and address.
To use this method, your app must declare the
android.permission.ACCESS_FINE_LOCATION permission in AndroidManifest.xml,
and the user must provide consent at runtime.
Task with
PlacesResponse.
Use isSuccessful()
to determine success or failure. If successful, then use
getPlaceLikelihoods() to get the current place information.| SecurityException | Thrown if a required permission is missing. |
|---|
Gets the semantic time intervals for the to the current time and location. As
examples, some attributes are:
TIME_INTERVAL_MORNING,
TIME_INTERVAL_AFTERNOON,
TIME_INTERVAL_EVENING,
TIME_INTERVAL_NIGHT,
TIME_INTERVAL_WEEKDAY,
TIME_INTERVAL_WEEKEND,
TIME_INTERVAL_HOLIDAY.
To use this method, your app must declare the
android.permission.ACCESS_FINE_LOCATION permission in AndroidManifest.xml,
and the user must provide consent at runtime.
Task with
TimeIntervalsResponse. Use isSuccessful()
to determine success or failure. If successful, then use
getTimeIntervals() to get the attributes of the current day and time.| SecurityException | Thrown if a required permission is missing. |
|---|
This method is deprecated.
This method is deprecated as of August 07, 2019, and will be turned off on January 31,
2020. Google does not offer alternate functionality for the Weather contextual
signal.
Gets the current weather conditions (temperature, feels-like temperature, dewpoint, humidity, etc.) at the current device location.
To use this method, your app must declare the
android.permission.ACCESS_FINE_LOCATION permission in AndroidManifest.xml,
and the user must provide consent at runtime.
Task with
WeatherResponse.
Check isSuccessful()
to determine success or failure. If successful, then use
getWeather() to get the current weather state.| SecurityException | Thrown if a required permission is missing. |
|---|