To save you the hassle of creating the connection button and wiring the button and metadata, Firebase offers the powerful Firebase UI for Android, where it will help us create the basic UI and wire up everything for us out of the box. So let's see how we can make it happen.
- In your login activity, add the following variable declarations:
private static final int RC_SIGN_IN = 17; FirebaseAuth auth;
- Next, in your onCreate() method, add the following :
auth = FirebaseAuth.getInstance(); if(auth.getCurrentUser() != null) { Log.d("Auth", "Logged in successfully"); } else { startActivityForResult( AuthUI.getInstance() .createSignInIntentBuilder() .setAvailableProviders( Arrays.asList( new AuthUI.IdpConfig.Builder(AuthUI. ...