public final class

SafetyNet

extends Object
java.lang.Object
   ↳ com.google.android.gms.safetynet.SafetyNet

Class Overview

The SafetyNet API provides access to Google services that help you assess the health and safety of an Android device.

To use SafetyNet, call getClient(Context) or getClient(Activity).

Summary

Fields
public static final Api<Api.ApiOptions.NoOptions> API This field is deprecated. use getClient(Context) or getClient(Activity).
public static final SafetyNetApi SafetyNetApi This field is deprecated. use getClient(Context) or getClient(Activity).
Public Methods
static SafetyNetClient getClient(Activity activity)
Returns a SafetyNetClient that is used to access all APIs that are called when the app has a foreground Activity.
static SafetyNetClient getClient(Context context)
Returns a SafetyNetClient that is used to access all APIs that are called without access to a foreground Activity.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

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

This field is deprecated.
use getClient(Context) or getClient(Activity).

The API necessary to use SafetyNet.

public static final SafetyNetApi SafetyNetApi

This field is deprecated.
use getClient(Context) or getClient(Activity).

The entry point for interacting with the SafetyNet APIs which help assess the health and safety of an Android device.

Public Methods

public static SafetyNetClient getClient (Activity activity)

Returns a SafetyNetClient that is used to access all APIs that are called when the app has a foreground Activity.

Use this method over getClient(Context) if your app has a foreground Activity and you will be making multiple API calls to improve performance.

Parameters
activity Activity
Returns
SafetyNetClient

public static SafetyNetClient getClient (Context context)

Returns a SafetyNetClient that is used to access all APIs that are called without access to a foreground Activity.

Parameters
context Context
Returns
SafetyNetClient