# Getting Profile Information

> [!WARNING]
> **Warning:** Google Sign-In for Android is outdated and no longer supported. To ensure the continued security and usability of your app, [migrate
> 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.

After you have signed in a user with Google, if you [configured Google Sign-In](https://developers.google.com/identity/sign-in/android/legacy-sign-in#configure_google_sign-in_and_the_googlesigninclient_object),
with the `DEFAULT_SIGN_IN` parameter or the `requestProfile` method, you can
access the user's basic profile information. If you configured Google Sign-In
with the `requestEmail` method, you can also get their email address.

> [!IMPORTANT]
> **Important:** Do not use a user's email address or user ID to communicate the currently signed-in user to your app's backend server. Instead, [send the user's
> ID token to your backend server](https://developers.google.com/identity/sign-in/android/backend-auth) and validate the token on the server, or use the [server auth code flow](https://developers.google.com/identity/sign-in/android/offline-access).

## Before you begin

- [Configure your Android Studio project](https://developers.google.com/identity/sign-in/android/legacy-start-integrating)
- [Integrate Google Sign-In into your app](https://developers.google.com/identity/sign-in/android/legacy-sign-in)

## Retrieve profile information for a signed-in user

Use the `GoogleSignIn.getLastSignedInAccount` method to request profile
information for the currently signed in user.

    GoogleSignInAccount acct = GoogleSignIn.getLastSignedInAccount(getActivity());
    if (acct != null) {
      String personName = acct.getDisplayName();
      String personGivenName = acct.getGivenName();
      String personFamilyName = acct.getFamilyName();
      String personEmail = acct.getEmail();
      String personId = acct.getId();
      Uri personPhoto = acct.getPhotoUrl();
    }

> [!NOTE]
> **Note:** A Google account's email address can change, so don't use it to identify a user. Instead, use the account's ID, which you can get on the client with `GoogleSignInAccount.getId`, and on the backend from the `sub` claim of the ID token.

For additional profile data that might be available, see
[`GoogleSignInAccount`](https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInAccount).
Note that any of the profile fields can be `null`, depending on which scopes
you requested and what information the user's profile includes.