Recaptcha
Stay organized with collections
Save and categorize content based on your preferences.
Inherited Method Summary
From class java.lang.Object
Public Methods
Returns a RecaptchaClient
that is used to access all APIs that are called when the app has a foreground Activity
.
Use this method over getClient(Context)
to improve performance if you plan to make multiple API
calls from your application's foreground Activity
.
Returns a RecaptchaClient
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."],[[["\u003cp\u003eThe reCAPTCHA API helps protect your app from spam and abuse by providing access to Google Cloud services, with more information available on reCAPTCHA Enterprise.\u003c/p\u003e\n"],["\u003cp\u003eTo create a reCAPTCHA client, use either \u003ccode\u003egetClient(Context)\u003c/code\u003e or \u003ccode\u003egetClient(Activity)\u003c/code\u003e, choosing the latter for better performance when working within a foreground Activity.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetClient(Activity)\u003c/code\u003e is recommended for making multiple API calls from an active Activity, while \u003ccode\u003egetClient(Context)\u003c/code\u003e is used when there's no foreground Activity.\u003c/p\u003e\n"]]],["The Recaptcha API, part of Google Cloud, protects apps from spam. To use it, instantiate a mobile client via `getClient(Context)` or `getClient(Activity)`. `getClient(Activity)` is for foreground activity and offers better performance when making multiple API calls. `getClient(Context)` is for use without a foreground activity. Both return a `RecaptchaClient` object used for accessing all the reCAPTCHA APIs.\n"],null,["# Recaptcha\n\npublic final class **Recaptcha** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nThe reCAPTCHA API provides access to Google Cloud services that help you protect your app\nfrom spam and other abusive actions. For more information, see [reCAPTCHA Enterprise](//cloud.google.com/recaptcha-enterprise)\n\nTo instantiate a reCAPTCHA mobile client, call [getClient(Context)](/android/reference/com/google/android/gms/recaptcha/Recaptcha#getClient(android.content.Context)) or [getClient(Activity)](/android/reference/com/google/android/gms/recaptcha/Recaptcha#getClient(android.app.Activity)). \n\n### Public Method Summary\n\n|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [RecaptchaClient](/android/reference/com/google/android/gms/recaptcha/RecaptchaClient) | [getClient](/android/reference/com/google/android/gms/recaptcha/Recaptcha#getClient(android.app.Activity))([Activity](//developer.android.com/reference/android/app/Activity.html) activity) Returns a [RecaptchaClient](/android/reference/com/google/android/gms/recaptcha/RecaptchaClient) that is used to access all APIs that are called when the app has a foreground [Activity](//developer.android.com/reference/android/app/Activity.html). |\n| static [RecaptchaClient](/android/reference/com/google/android/gms/recaptcha/RecaptchaClient) | [getClient](/android/reference/com/google/android/gms/recaptcha/Recaptcha#getClient(android.content.Context))([Context](//developer.android.com/reference/android/content/Context.html) context) Returns a [RecaptchaClient](/android/reference/com/google/android/gms/recaptcha/RecaptchaClient) that is used to access all APIs that are called without access to a foreground [Activity](//developer.android.com/reference/android/app/Activity.html). |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods\n--------------\n\n#### public static [RecaptchaClient](/android/reference/com/google/android/gms/recaptcha/RecaptchaClient)\n**getClient** ([Activity](//developer.android.com/reference/android/app/Activity.html) activity)\n\nReturns a [RecaptchaClient](/android/reference/com/google/android/gms/recaptcha/RecaptchaClient)\nthat is used to access all APIs that are called when the app has a foreground\n[Activity](//developer.android.com/reference/android/app/Activity.html).\n\nUse this method over [getClient(Context)](/android/reference/com/google/android/gms/recaptcha/Recaptcha#getClient(android.content.Context)) to improve performance if you plan to make multiple API\ncalls from your application's foreground [Activity](//developer.android.com/reference/android/app/Activity.html). \n\n#### public static [RecaptchaClient](/android/reference/com/google/android/gms/recaptcha/RecaptchaClient)\n**getClient** ([Context](//developer.android.com/reference/android/content/Context.html) context)\n\nReturns a [RecaptchaClient](/android/reference/com/google/android/gms/recaptcha/RecaptchaClient)\nthat is used to access all APIs that are called without access to a foreground\n[Activity](//developer.android.com/reference/android/app/Activity.html)."]]