SnapshotApi

public interface SnapshotApi

This interface is deprecated.
The Awareness API is deprecated and will be turned down in a future Google Play services release, as early as January 2027. There is no direct replacement.

Deprecated entry point for the Awareness Snapshot API using GoogleApiClient.

The methods must be used in conjunction with a GoogleApiClient instance. For example:


     new GoogleApiClient.Builder(context)
             .addApi(Awareness.API)
             .addConnectionCallbacks(this)
             .addOnConnectionFailedListener(this)
             .build()
 

Public Method Summary

abstract PendingResult<BeaconStateResult>
getBeaconState(GoogleApiClient client, Collection<BeaconState.TypeFilter> beaconTypes)
This method is deprecated. The Awareness API is deprecated and will be turned down in a future Google Play services release, as early as January 2027. There is no direct replacement.
abstract PendingResult<BeaconStateResult>
getBeaconState(GoogleApiClient client, TypeFilter... beaconTypes)
This method is deprecated. The Awareness API is deprecated and will be turned down in a future Google Play services release, as early as January 2027. There is no direct replacement.
abstract PendingResult<DetectedActivityResult>
getDetectedActivity(GoogleApiClient client)
This method is deprecated. The Awareness API is deprecated and will be turned down in a future Google Play services release, as early as January 2027. There is no direct replacement.
abstract PendingResult<HeadphoneStateResult>
getHeadphoneState(GoogleApiClient client)
This method is deprecated. The Awareness API is deprecated and will be turned down in a future Google Play services release, as early as January 2027. There is no direct replacement.
abstract PendingResult<LocationResult>
getLocation(GoogleApiClient client)
This method is deprecated. The Awareness API is deprecated and will be turned down in a future Google Play services release, as early as January 2027. There is no direct replacement.
abstract PendingResult<TimeIntervalsResult>
getTimeIntervals(GoogleApiClient client)
This method is deprecated. The Awareness API is deprecated and will be turned down in a future Google Play services release, as early as January 2027. There is no direct replacement.

Public Methods

public abstract PendingResult<BeaconStateResult> getBeaconState (GoogleApiClient client, Collection<BeaconState.TypeFilter> beaconTypes)

This method is deprecated.
The Awareness API is deprecated and will be turned down in a future Google Play services release, as early as January 2027. There is no direct replacement.

Get 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, Result.getStatus() will return status code AwarenessStatusCodes.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.

Parameters
client A GoogleApiClient instance.
beaconTypes The types of beacon attachments to return. See Beacons for details about beacon attachments.
Returns
Throws
SecurityException Thrown if a required permission is missing.

public abstract PendingResult<BeaconStateResult> getBeaconState (GoogleApiClient client, TypeFilter... beaconTypes)

This method is deprecated.
The Awareness API is deprecated and will be turned down in a future Google Play services release, as early as January 2027. There is no direct replacement.

Get 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, Result.getStatus() will return status code AwarenessStatusCodes.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.

Parameters
client A GoogleApiClient instance.
beaconTypes The types of beacon attachments to return. See Beacons for details about beacon attachments.
Returns
Throws
SecurityException Thrown if a required permission is missing.

public abstract PendingResult<DetectedActivityResult> getDetectedActivity (GoogleApiClient client)

This method is deprecated.
The Awareness API is deprecated and will be turned down in a future Google Play services release, as early as January 2027. There is no direct replacement.

Get the user's current activity (e.g., running, walking, biking, driving, etc.).

To call this function, a different permission is required depending on your Android API level:

  • For Android 10 (API level 29) and later: android.permission.ACTIVITY_RECOGNITION permission
  • For Android 9 (API level 28) and earlier: com.google.android.gms.permission.ACTIVITY_RECOGNITION permission
Parameters
client A GoogleApiClient instance.
Returns
Throws
SecurityException Thrown if a required permission is missing.

public abstract PendingResult<HeadphoneStateResult> getHeadphoneState (GoogleApiClient client)

This method is deprecated.
The Awareness API is deprecated and will be turned down in a future Google Play services release, as early as January 2027. There is no direct replacement.

Report whether headphones are plugged into the device.

Parameters
client A GoogleApiClient instance.
Returns

public abstract PendingResult<LocationResult> getLocation (GoogleApiClient client)

This method is deprecated.
The Awareness API is deprecated and will be turned down in a future Google Play services release, as early as January 2027. There is no direct replacement.

Get 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.

Parameters
client A GoogleApiClient instance.
Returns
Throws
SecurityException Thrown if a required permission is missing.

public abstract PendingResult<TimeIntervalsResult> getTimeIntervals (GoogleApiClient client)

This method is deprecated.
The Awareness API is deprecated and will be turned down in a future Google Play services release, as early as January 2027. There is no direct replacement.

Get the semantic time intervals for the to the current time and location. As examples, some attributes are: TimeFence.TIME_INTERVAL_MORNING, TimeFence.TIME_INTERVAL_AFTERNOON, TimeFence.TIME_INTERVAL_EVENING, TimeFence.TIME_INTERVAL_NIGHT, TimeFence.TIME_INTERVAL_WEEKDAY, TimeFence.TIME_INTERVAL_WEEKEND, TimeFence.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.

Parameters
client A GoogleApiClient instance.
Returns
Throws
SecurityException Thrown if a required permission is missing.