LocationServices

public class LocationServices extends Object

The main entry point for location services integration.

Field Summary

public static final Api<Api.ApiOptions.NoOptions> API This field is deprecated. Use FusedLocationProviderClient instead.
public static final FusedLocationProviderApi FusedLocationApi This field is deprecated. Use FusedLocationProviderClient instead.
public static final GeofencingApi GeofencingApi This field is deprecated. Use GeofencingClient instead.
public static final SettingsApi SettingsApi This field is deprecated. Use SettingsClient instead.

Public Method Summary

static FusedLocationProviderClient
getFusedLocationProviderClient(Activity activity)
Create a new instance of FusedLocationProviderClient for use in an Activity.
static FusedLocationProviderClient
getFusedLocationProviderClient(Context context)
Create a new instance of FusedLocationProviderClient for use in a non-activity Context.
static FusedOrientationProviderClient
static FusedOrientationProviderClient
getFusedOrientationProviderClient(Context context)
Create a new instance of FusedOrientationProviderClient for use in a non-activity Context.
static GeofencingClient
getGeofencingClient(Activity activity)
Create a new instance of GeofencingClient for use in an Activity.
static GeofencingClient
getGeofencingClient(Context context)
Create a new instance of GeofencingClient for use in a non-activity Context.
static SettingsClient
getSettingsClient(Context context)
Create a new instance of SettingsClient for use in a non-activity Context.
static SettingsClient
getSettingsClient(Activity activity)
Create a new instance of SettingsClient for use in an Activity.

Inherited Method Summary

Fields

public static final Api<Api.ApiOptions.NoOptions> API

This field is deprecated.
Use FusedLocationProviderClient instead.

Token to pass to GoogleApiClient.Builder.addApi(Api ) to enable LocationServices.

public static final FusedLocationProviderApi FusedLocationApi

This field is deprecated.
Use FusedLocationProviderClient instead.

Old entry point to the Fused Location Provider APIs.

public static final GeofencingApi GeofencingApi

This field is deprecated.
Use GeofencingClient instead.

Old entry point to the geofencing APIs.

public static final SettingsApi SettingsApi

This field is deprecated.
Use SettingsClient instead.

Old entry point to the location settings APIs.

Public Methods

public static FusedLocationProviderClient getFusedLocationProviderClient (Activity activity)

Create a new instance of FusedLocationProviderClient for use in an Activity. Error resolutions will be automatically launched from the provided Activity, displaying UI when necessary.

public static FusedLocationProviderClient getFusedLocationProviderClient (Context context)

Create a new instance of FusedLocationProviderClient for use in a non-activity Context. Error resolutions will be automatically launched from the provided Context, displaying system tray notifications when necessary.

public static FusedOrientationProviderClient getFusedOrientationProviderClient (Activity activity)

Create a new instance of FusedOrientationProviderClient for use in an Activity. Error resolutions will be automatically launched from the provided Activity, displaying UI when necessary.

public static FusedOrientationProviderClient getFusedOrientationProviderClient (Context context)

Create a new instance of FusedOrientationProviderClient for use in a non-activity Context. Error resolutions will be automatically launched from the provided Context, displaying system tray notifications when necessary.

public static GeofencingClient getGeofencingClient (Activity activity)

Create a new instance of GeofencingClient for use in an Activity. Error resolutions will be automatically launched from the provided Activity, displaying UI when necessary.

public static GeofencingClient getGeofencingClient (Context context)

Create a new instance of GeofencingClient for use in a non-activity Context. Error resolutions will be automatically launched from the provided Context, displaying system tray notifications when necessary.

public static SettingsClient getSettingsClient (Context context)

Create a new instance of SettingsClient for use in a non-activity Context. Error resolutions will be automatically launched from the provided Context, displaying system tray notifications when necessary.

public static SettingsClient getSettingsClient (Activity activity)

Create a new instance of SettingsClient for use in an Activity. Error resolutions will be automatically launched from the provided Activity, displaying UI when necessary.