Skip to content

Google Sign-In guide

This guide will walk you through on how to display a screen on your watch app so that users can select their Google account to sign-in to your app.


Follow the setup instructions for integrating Google Sign-in into an Android app from this link.

Getting started

  1. Add dependencies

    Add the following dependencies to your project’s build.gradle:

    dependencies {
        implementation "<version>"
        implementation "<version>"
        implementation "<version>"
  2. Create an instance of GoogleSignInClient

    Create an instance of GoogleSignInClient, according to your requirements, for example:

    val googleSignInClient = GoogleSignIn.getClient(

Display the screen

  1. Create a ViewModel

    Create your implementation of GoogleSignInViewModel, passing the GoogleSignInClient created:

    class MyGoogleSignInViewModel(
        googleSignInClient: GoogleSignInClient,
    ) : GoogleSignInViewModel(googleSignInClient)
  2. Display the screen

    Display the GoogleSignInScreen passing an instance of the GoogleSignInViewModel created:

       onAuthCancelled = { /* code to navigate to another screen on this event */ },
       onAuthSucceed = { /* code to navigate to another screen on this event */ },
       viewModel = hiltViewModel<MyGoogleSignInViewModel>()

This sample uses Hilt to retrieve an instance of the ViewModel, but you should use what suits your project best, see this link for more info.

Retrieve the signed in account

In order to have access an instance of the GoogleSignInAccount selected by the user, follow the steps:

  1. Implement GoogleSignInEventListener

    class GoogleSignInEventListenerImpl : GoogleSignInEventListener {
        override suspend fun onSignedIn(account: GoogleSignInAccount) {
            // your implementation using the account parameter
  2. Pass the listener to the ViewModel

    Pass an instance of GoogleSignInEventListener to GoogleSignInViewModel:

    class MyGoogleSignInViewModel(
     googleSignInClient: GoogleSignInClient,
     googleSignInEventListener: GoogleSignInEventListener,
    ) : GoogleSignInViewModel(googleSignInClient, googleSignInEventListener)