[ Web Proxy ]
URL:
Viewing: https://developers.google.com/android/reference/com/google/android/gms/safetynet/SafetyNet [Back]  [Original]

SafetyNet  |  Google Play services  |  Google for Developers Skip to main content

SafetyNet Stay organized with collections Save and categorize content based on your preferences.

outlined_flag
public final class SafetyNet extends Object

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

Field Summary

public static final Api<Api.ApiOptions.NoOptions> API This field was deprecated. use getClient(Context) or getClient(Activity).
public static final SafetyNetApi SafetyNetApi This field was deprecated. use getClient(Context) or getClient(Activity).

Public Method Summary

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.

Inherited Method Summary

Fields

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

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

The API necessary to use SafetyNet.

public static final SafetyNetApi SafetyNetApi

This field was 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.

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.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-10-31 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page