Most applications are connected to a backend and utilize external services. Developing your own backend and services can be time consuming, and involves managing the scalability and security of your servers, as well as implementing the features you need, whether that being storing and retrieving user data in real time, authentication through third party identity providers, app analytics, maps and location integration, remote app configuration, etc...

To make app development easier, Google offers a wide array of services. A lot of these features are part of Google Firebase - a service that can act as the backend for your application. Today we are going to see how this service can help us with two fundamental things in app development:

What you'll learn

Create a new project in the Firebase console. Connect that project to a new Android Studio project.

Integrate sign-in functionality using FirebaseUI. When the user is logged in, display a greeting with their username.

Give an option for the user to sign out.

Store some data from an EditText on the Firebase Realtime Database.

Retrieve the data from previous exercise and show it in a TextView.

myRef.addChildEventListener(new ChildEventListener() {

   public void onChildAdded(DataSnapshot dataSnapshot, String s) {}

   public void onChildChanged(DataSnapshot dataSnapshot, String s) {}

   public void onChildRemoved(DataSnapshot dataSnapshot) {}

   public void onChildMoved(DataSnapshot dataSnapshot, String s) {}

   public void onCancelled(DatabaseError databaseError) {}

});

Already done? Expand on the functionality of your application, or try out one of these: