Skip to Content
Firebase Cookbook
book

Firebase Cookbook

by Houssem Yahiaoui
November 2017
Beginner to intermediate content levelBeginner to intermediate
288 pages
7h 33m
English
Packt Publishing
Content preview from Firebase Cookbook

How to do it...

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.

  1. In your login activity, add the following variable declarations: 
       private static final int RC_SIGN_IN = 17;       FirebaseAuth auth;
  1. 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. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Firebase for Android Development

Mastering Firebase for Android Development

Ashok Kumar S

Publisher Resources

ISBN: 9781788296335Supplemental Content