O'Reilly logo

Firebase Cookbook by Houssem Yahiaoui

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

First, let us take a look at how we will implement this recipe in Android:

  1. Now, after installing our dependencies, we will need to create the UI for our calls. To do that, simply copy and paste the following special button XML code into your layout:
      <com.google.android.gms.common.SignInButton       android:id="@+id/gbtn"       android:layout_width="368dp"       android:layout_height="wrap_content"      android:layout_marginLeft="16dp"      android:layout_marginTop="30dp"      app:layout_constraintLeft_toLeftOf="parent"      app:layout_constraintTop_toTopOf="parent"      android:layout_marginRight="16dp"      app:layout_constraintRight_toRightOf="parent" />

The result will be this:

Figure 11: Google Sign-in button after the declaration
  1. After doing that, let's see the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required