How to do it...

We will first see how we can implement anonymous authentication in Android:

  1. Fire up your Android Studio. Before doing anything, we need to get some dependencies first, speaking, of course, of the Firebase Auth library that can be downloaded by adding this line to the build.gradle file under the dependencies section:
       compile ''
  1. Now simply Sync and you will be good to start adding Firebase Authentication logic. Let us see what we're going to get as a final result: 
Figure 6: Android application: anonymous login application

A simple UI with a button and a TextView, where we put our ...

Get Firebase Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.