ফাইল > খুলুন নির্বাচন করুন, আপনি যেখানে google-services সংগ্রহস্থল ক্লোন করেছেন সেখানে ব্রাউজ করুন এবং google-services/android/signin খুলুন।
একটি Google API কনসোল প্রকল্প কনফিগার করুন
নমুনাটি ব্যবহার করতে, আপনাকে একটি Android ক্লায়েন্ট এবং একটি ওয়েব অ্যাপ্লিকেশন ক্লায়েন্টের সাথে একটি Google API কনসোল প্রকল্প কনফিগার করতে হবে:
API কনসোলে একটি বিদ্যমান প্রকল্প খুলুন, অথবা যদি আপনার কাছে ইতিমধ্যে একটি না থাকে তাহলে একটি প্রকল্প তৈরি করুন৷
OAuth সম্মতি স্ক্রীন পৃষ্ঠায়, নিশ্চিত করুন যে সমস্ত তথ্য সম্পূর্ণ এবং সঠিক।
শংসাপত্র পৃষ্ঠায়, একটি অ্যান্ড্রয়েড টাইপ ক্লায়েন্ট আইডি তৈরি করুন। নমুনা অ্যাপের প্যাকেজের নাম হল com .google .samples .quickstart .signin । আপনাকে আপনার সাইনিং সার্টিফিকেট ফিঙ্গারপ্রিন্ট থেকে SHA-1 হ্যাশ প্রদান করতে হবে। তথ্যের জন্য আপনার ক্লায়েন্ট প্রমাণীকরণ দেখুন।
শংসাপত্র পৃষ্ঠায়, একটি ওয়েব অ্যাপ্লিকেশন টাইপ ক্লায়েন্ট আইডি তৈরি করুন। আপনি অনুমোদিত জাভাস্ক্রিপ্ট অরিজিন এবং অনুমোদিত রিডাইরেক্ট ইউআরআই ক্ষেত্রগুলি ফাঁকা রাখতে পারেন। এই ওয়েব ক্লায়েন্ট আইডিটি নমুনার IdTokenActivity এবং ServerAuthCodeActivity উদাহরণগুলির জন্য প্রয়োজন৷ একটি বাস্তব অ্যাপে, এই ক্লায়েন্ট আইডি আপনার অ্যাপের ব্যাকএন্ড সার্ভারের প্রতিনিধিত্ব করবে।
আপনার প্রজেক্টের strings.xml ফাইলে ক্লায়েন্ট আইডি কপি এবং পেস্ট করুন:
এখন আপনি নমুনা তৈরি করতে এবং Android স্টুডিও থেকে এটি চালানোর জন্য প্রস্তুত৷
নমুনা তৈরি করুন এবং রান বোতামে ক্লিক করুন এবং Google Play পরিষেবাগুলির সর্বশেষ সংস্করণ সহ একটি সংযুক্ত ডিভাইস বা এমুলেটর নির্বাচন করুন৷
এটা কিভাবে কাজ করে
অ্যাপ্লিকেশনটি একটি GoogleSignInClient তৈরি করে, এটির প্রয়োজনীয় সাইন-ইন বিকল্পগুলি নির্দিষ্ট করে৷ তারপর, যখন সাইন-ইন বোতামটি ক্লিক করা হয়, তখন অ্যাপ্লিকেশনটি সাইন-ইন অভিপ্রায় শুরু করে, যা ব্যবহারকারীকে একটি Google অ্যাকাউন্ট দিয়ে সাইন ইন করতে অনুরোধ করে।
// Configure sign-in to request the user's ID, email address, and basic// profile. ID and basic profile are included in DEFAULT_SIGN_IN.GoogleSignInOptionsgso=newGoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN).requestEmail().build();
// Build a GoogleSignInClient with the options specified by gso.mGoogleSignInClient=GoogleSignIn.getClient(this,gso);
ফাইল > খুলুন নির্বাচন করুন, আপনি যেখানে google-services সংগ্রহস্থল ক্লোন করেছেন সেখানে ব্রাউজ করুন এবং google-services/android/signin খুলুন।
একটি Google API কনসোল প্রকল্প কনফিগার করুন
নমুনাটি ব্যবহার করতে, আপনাকে একটি Android ক্লায়েন্ট এবং একটি ওয়েব অ্যাপ্লিকেশন ক্লায়েন্টের সাথে একটি Google API কনসোল প্রকল্প কনফিগার করতে হবে:
API কনসোলে একটি বিদ্যমান প্রকল্প খুলুন, অথবা যদি আপনার কাছে ইতিমধ্যে একটি না থাকে তাহলে একটি প্রকল্প তৈরি করুন৷
OAuth সম্মতি স্ক্রীন পৃষ্ঠায়, নিশ্চিত করুন যে সমস্ত তথ্য সম্পূর্ণ এবং সঠিক।
শংসাপত্র পৃষ্ঠায়, একটি অ্যান্ড্রয়েড টাইপ ক্লায়েন্ট আইডি তৈরি করুন। নমুনা অ্যাপের প্যাকেজের নাম হল com .google .samples .quickstart .signin । আপনাকে আপনার সাইনিং সার্টিফিকেট ফিঙ্গারপ্রিন্ট থেকে SHA-1 হ্যাশ প্রদান করতে হবে। তথ্যের জন্য আপনার ক্লায়েন্ট প্রমাণীকরণ দেখুন।
শংসাপত্র পৃষ্ঠায়, একটি ওয়েব অ্যাপ্লিকেশন টাইপ ক্লায়েন্ট আইডি তৈরি করুন। আপনি অনুমোদিত জাভাস্ক্রিপ্ট অরিজিন এবং অনুমোদিত রিডাইরেক্ট ইউআরআই ক্ষেত্রগুলি ফাঁকা রাখতে পারেন। এই ওয়েব ক্লায়েন্ট আইডিটি নমুনার IdTokenActivity এবং ServerAuthCodeActivity উদাহরণগুলির জন্য প্রয়োজন৷ একটি বাস্তব অ্যাপে, এই ক্লায়েন্ট আইডি আপনার অ্যাপের ব্যাকএন্ড সার্ভারের প্রতিনিধিত্ব করবে।
আপনার প্রজেক্টের strings.xml ফাইলে ক্লায়েন্ট আইডি কপি এবং পেস্ট করুন:
এখন আপনি নমুনা তৈরি করতে এবং Android স্টুডিও থেকে এটি চালানোর জন্য প্রস্তুত৷
নমুনা তৈরি করুন এবং রান বোতামে ক্লিক করুন এবং Google Play পরিষেবাগুলির সর্বশেষ সংস্করণ সহ একটি সংযুক্ত ডিভাইস বা এমুলেটর নির্বাচন করুন৷
এটা কিভাবে কাজ করে
অ্যাপ্লিকেশনটি একটি GoogleSignInClient তৈরি করে, এটির প্রয়োজনীয় সাইন-ইন বিকল্পগুলি নির্দিষ্ট করে৷ তারপর, যখন সাইন-ইন বোতামটি ক্লিক করা হয়, তখন অ্যাপ্লিকেশনটি সাইন-ইন অভিপ্রায় শুরু করে, যা ব্যবহারকারীকে একটি Google অ্যাকাউন্ট দিয়ে সাইন ইন করতে অনুরোধ করে।
// Configure sign-in to request the user's ID, email address, and basic// profile. ID and basic profile are included in DEFAULT_SIGN_IN.GoogleSignInOptionsgso=newGoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN).requestEmail().build();
// Build a GoogleSignInClient with the options specified by gso.mGoogleSignInClient=GoogleSignIn.getClient(this,gso);
[null,null,["2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eGoogle Sign-In for Android is outdated and developers should migrate to Credential Manager for enhanced security and user experience.\u003c/p\u003e\n"],["\u003cp\u003eCredential Manager supports passkey, password, and federated identity authentication, including Sign-in with Google.\u003c/p\u003e\n"],["\u003cp\u003eWear OS developers should continue using Google Sign-In for Android until Credential Manager support is available for their specific Wear OS versions.\u003c/p\u003e\n"],["\u003cp\u003eTo use the provided sample app, configure a Google API Console project with an Android and a Web application client ID.\u003c/p\u003e\n"],["\u003cp\u003eThe sample app demonstrates how to build a \u003ccode\u003eGoogleSignInClient\u003c/code\u003e and initiate the sign-in process with a user's Google account.\u003c/p\u003e\n"]]],[],null,["# Try Sign-In for Android\n\n| **Warning:** Google Sign-In for Android is outdated and no longer supported. To ensure the continued security and usability of your app, [migrate\n| to Credential Manager](https://developer.android.com/training/sign-in/credential-manager/) today. Credential Manager supports passkey, password, and federated identity authentication (such as Sign-in with Google), stronger security, and a more consistent user experience. For Wear developers: Credential Manager will be supported in Wear OS 5.1 and later on selected watches. Developers actively supporting Wear OS 3, 4 and 5.0 devices with Sign in with Google should continue using Google Sign-in for Android for your Wear applications. Sign in with Google support will be available on Credential Manager APIs for these versions of WearOS at a later date.\n\nUse our Android sample app to see how Sign-In works, or\n[add Sign-In to your existing app](/identity/sign-in/android/legacy-start-integrating).\n\n**Required:** The latest versions of\n[Android Studio](//developer.android.com/sdk/) and\n[Google Play Services](//developer.android.com/sdk/installing/adding-packages.html).\n\nGet the project\n---------------\n\nIf this is your first time using a Google services sample,\ncheck out the google-services repository. \n\n```\n$ git clone https://github.com/googlesamples/google-services.git\n```\n\nOpen Android Studio.\n\nSelect **File \\\u003e Open** , browse to where you cloned the\n`google-services` repository, and open\n`google-services/android/signin`.\n\nConfigure a Google API Console project\n--------------------------------------\n\nTo use the sample, you need to configure a Google API Console project with an Android client and a Web application client:\n\n1. Open an existing project in the [API Console](https://console.cloud.google.com/), or create a project if you don't already have one.\n2. On the OAuth consent screen page, make sure all of the information is complete and accurate.\n3. On the Credentials page, create an **Android** type client ID. The package name for the sample app is `com``.google``.samples``.quickstart``.signin`. You will also need to provide the SHA-1 hash from your signing certificate fingerprint. See [Authenticating Your Client](/android/guides/client-auth) for information.\n4. On the Credentials page, create a **Web application** type client ID. You can leave the Authorized JavaScript Origins and Authorized redirect URIs fields blank. This web client ID is required by the sample's `IdTokenActivity` and `ServerAuthCodeActivity` examples. In a real app, this client ID would represent your app's backend server.\n5.\n Copy and paste the client ID into your project's `strings.xml` file:\n\n ```\n \u003cstring name=\"server_client_id\"\u003eYOUR_SERVER_CLIENT_ID\u003c/string\u003e\n ```\n\nRun the sample\n--------------\n\nNow you're ready to build the sample and run it from Android Studio.\n\nBuild the sample and click the run button and select a connected\ndevice or emulator with the latest version of Google Play services.\n\nHow it works\n------------\n\nThe application builds a `GoogleSignInClient`, specifying\nthe sign-in options it needs. Then, when the sign-in button is\nclicked, the application starts the sign-in intent, which prompts the\nuser to sign in with a Google account. \n\n```carbon\n// Configure sign-in to request the user's ID, email address, and basic\n// profile. ID and basic profile are included in DEFAULT_SIGN_IN.\nGoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestEmail()\n .build();\n``` \n\n```scilab\n// Build a GoogleSignInClient with the options specified by gso.\nmGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n``` \n\n```scdoc\nprivate void signIn() {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n}\n```\n\nNext steps\n----------\n\nIf you want to see how you can implement Google Sign-In in\nyour own app, take a look at our implementation guide.\n\n[Add Sign-In to your app](/identity/sign-in/android/legacy-start-integrating)\n\nDid you have a good experience? Run into trouble?\n[Let us know!]()"]]