Skip to Main Content
Mastering Firebase for Android Development
book

Mastering Firebase for Android Development

by Ashok Kumar S
June 2018
Beginner to intermediate content levelBeginner to intermediate
394 pages
9h 2m
English
Packt Publishing
Content preview from Mastering Firebase for Android Development

Code for Google provider

Now that we have all the necessary settings in place, the following piece of code helps in initializing Google Sign-in for your project:

private List<AuthUI.IdpConfig> getAuthProviderList() {    List<AuthUI.IdpConfig> providers = new ArrayList<>();    providers.add(new            AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build());    providers.add(new            AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build());    return providers;}private void authenticate() {    startActivityForResult(            AuthUI.getInstance().createSignInIntentBuilder()                    .setAvailableProviders(getAuthProviderList())                    .setIsSmartLockEnabled(false)                    .build(),            REQUEST_CODE);}

This code is self-explanatory, as we have just one line of code to enable Google Sign-in. We also have ...

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

Beginning React and Firebase: Create Four Beginner-Friendly Projects Using React and Firebase

Beginning React and Firebase: Create Four Beginner-Friendly Projects Using React and Firebase

Nabendu Biswas

Publisher Resources

ISBN: 9781788624718Supplemental Content