Firebase for Android Development
3.7 (6 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
27 students enrolled

Firebase for Android Development

Develop real-time Firebase backends for your Android apps. Increase user engagement and build apps faster
3.7 (6 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
27 students enrolled
Created by Packt Publishing
Last updated 9/2018
English [Auto-generated]
Current price: $86.99 Original price: $124.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 2.5 hours on-demand video
  • 1 downloadable resource
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Identify Firebase backend solutions that get your app connected to the cloud
  • Build a scalable cloud database that can work in real-time as well as offline
  • Create a system to validate users and allow their data to be synced across their different devices
  • Store large files such as images on cloud storage connected to your database
  • Leverage the power of analytics to log events and find out what features are being used most by your users
  • Split users into segments to target them with push notifications they need and give them an improved in-app experience.
  • Conduct different user and device tests and pinpoint the cause of bugs in your app
Course content
Expand all 39 lectures 02:34:14
+ Introduction to Firebase
4 lectures 12:14

This video provides an overview of the entire course.

Preview 02:43

Before we can start learning how to develop using Firebase, we must first understand what it is and what it’s capable of.

   •  Gain an overview and basic understanding of Firebase and its services.

   •  Understand Firebase

   •  Understand Firebase services

What Is Firebase?

To get us into gear with the app we’ll be building, we need to know what it is we’re developing for.

   •  Learn about the ValueList we’ll be making as well as the Firebase services we’ll be integrating.

   •  Integrate the Firebase services

Final Project Demo

We need to make sure everything is ready for when we start developing using Firebase and using its services.

   •  Create the Android Studio Project

   •  Connect the App to Firebase using the Firebase Assistant

Environment Setup
+ Storing Data with the Firestore Database
8 lectures 31:44

Before setting up a database in an app, one must know what they are creating. This video will show viewers the database structure we’ll be creating in the following videos.

   •  Know about Firestore’s document-structured model

   •  Know what collections and documents are

   •  Create the actual data model

Preview 01:54

Each Firebase service needs a dependency to be used. This video will ensure videos know where to find them and how to add them into the app.

   •  Find the dependency in the official Firebase docs

   •  Paste the dependency in the app-level build.gradle file

Importing Firebase Dependencies

In order to provide a log-in interface for our users, we can use Firebase Authentication to provide us with that and let it handle most of the background tasks that would normally take hours off of a developer’s time.

   •  Gain an overview of Firebase Authentication

   •  Understand Firebase Authentication

Introducing Firebase Authentication

In our data model, we decided we wanted to store data that belongs to a user by storing it under their userID. We’ll get this userID by allowing our users to sign into our app and use FirebaseUI to provide a ready-made fully-optimized login screen.

   •  Import the FirebaseUI dependency

   •  Create a signInIntent with AuthUI, passing a list of providers

   •  Add a log out button in the menu

Getting Users Authenticated

We’ll be wanting to store our user’s data on a cloud database so that their list items can be saved and synced across different devices through their account. This video shows how Cloud Firestore gives us a pretty nice way of doing so.

   •  Gain an overview of Cloud Firestore

   •  Understand Cloud Firestore

Introducing Cloud Firestore

In this video we will write data to the database and read from it in real-time, allowing our to-do list to update as new data is discovered.

   •  Initialize Cloud Firestore

   •  Create the upload function with a hashmap

   •  Add a listener to download data into a snapshot

Storing Data with Firestore

In this video we will read and write to and from our database, but we lack a way to delete our list items. We fix that here by creating a custom adapter with a dedicated delete button.

   •  Create the list item layout and custom adapter.

   •  Add an onClickListener to the delete button in the adapter

   •  Delete the item from the list and recreate the hashmap to upload again

Deleting List Items

An unprotected database is a very frail one. We’ll learn the ways of database security as we learn how to write our own security rules for the database.

   •  Learn about the match and allow functions

   •  Access pre-defined variables such as request and resource

   •  Understand hierarchical data and wildcards

Understanding Firestore Security Rules
+ Access Cloud Storage
6 lectures 42:03

Integrating multiple Firebase services can often lead to a few common mistakes

   •  Create a menu to provide a way to log out

   •  Stop addListListener from being called when not authenticated

   •  Call initFirebase again when the user signs in

Preview 04:48

Right now, our apps looks, well, plain. We’ll take a little break from the pace of development as we focus on the design of our app.

   •  Style the list items and add a divider

   •  Use the AndroidBootstrap library to design the button

   •  Use the ExpandableLayout library to design the insert-item field

Designing Our App

This video aims to provide a good understanding of Firebase Cloud Storage and what makes it stand out from other cloud storage services.

   •  Knowing the three main advantages of Firebase Cloud Storage

Introducing Firebase Cloud Storage

This video aims to show how to upload files. 3 methods are available to Firebase Cloud Storage for uploading, and we’ll pick one with reasoning and show how to use that.

   •  Pick the upload method to use

   •  Copy the file into the app’s directory and get its URI

   •  Create a StorageReference and call putFile

Uploading Images to the Cloud

On top of the same problems with uploading files (multi-method choice), we must make checks to see if the file already exists in local storage so we don’t have to tap into the network each time we want to see the image.

   •  Make checks to see if file is in local storage

   •  Pick the download method to use

   •  Create the StorageReference and call getFile

Downloading and Displaying Images

Just like with the database, we want to protect our files from hackers. The security rules for Cloud Storage are very similar to Firestore’s, but there are some subtle key differences which can catch many off-guard.

   •  Go over key difference in the match statement

   •  Go over desired pre-defined variables

Storage Security Rules
+ Learning about Our Users with Analytics
5 lectures 20:11

Every app needs some sort of Analytics integrated to understand its users and progress well. We’ll gain an understanding of how Firebase Analytics does that as well as how it excels in certain fields.

   •  Gain an overview of Firebase Analytics

Preview 01:30

This video aims to present all the tools of Firebase Analytics many of which are ignored and heavily underestimated. We go into what each tool is used for and when to use them.

   •  Identifying the data in the Analytics main dashboard

   •  Getting familiar with each Analytics tool

Visiting Our Analytics Dashboard

Firebase does set up pre-defined events we can see in our Events tool of Analytics, but we can leverage this tool even further by logging our own events so we can observe exactly how our users are using our app.

   •  Initialize Firebase Analytics

   •  Log the event as a bundle of key/value pairs

   •  Enable debug mode if required

Logging Key Events

One of the key aspects of Firebase Analytics is user segmentation: a way of defining users into grouped segments so that we can utilize the full potential of other Firebase services including Cloud Messaging, Remote Config, and A/B Testing.

   •  Gain an overview of User Segmentation

What Is User Segmentation?

One of the more powerful tools of Firebase Analytics is the ability to define user segments. We can use these to observe how many of our users fall into certain categories, or to target them with features like Cloud Messaging and Remote Config which we’ll be doing later on.

   •  Add the user property in the Firebase Console

   •  Set the user property in the app’s code

   •  Create audiences in the Firebase Console to observe and target

Defining User Segments
+ Reaching Out to Users with Cloud Messaging
3 lectures 08:26

To let users feel they’re special, we can tell them about important things going on that could be of potential value to them. We’ll learn how to do that with Firebase Cloud Messaging

   •  Gain an overview of Firebase Cloud Messaging

Introducing Firebase Cloud Messaging

Now that we know about Cloud Messaging, we need to learn how to use it. The most basic and straightforward way is to send messages manually using the Firebase Console.

   •  Import the Cloud Messaging dependency

   •  Create the services that will allow the device to receive the messages

   •  Go to Cloud Messaging in the Console to access the Message Builder

Sending Messages Through the Console

Using the Console to send messages is great when we want to manually pass on information and updates, but that’s not very versatile. Cloud Messaging has a few other applications that greatly expand its array of uses.

   •  Learn about the different applications of Cloud Messaging

Different Applications of Cloud Messaging
+ Tailoring In-App Experience with Remote Config
3 lectures 08:07

It’s not easy to plan all our users with a single solution. By using Remote Config to store parameters on the cloud, we can serve different configurations to each group of users so that everyone’s happy.

   •  Gain an overview of Firebase Remote Config

Introducing Firebase Remote Config

We need to create parameters to store locally on the device as well as on the cloud as well as set the different configurations for each user segment.

   •  Create configdefaults.xml which includes each parameter and their default values

   •  Create the parameters again in the Console and add their different configurations

   •  Create the fetchParameters method

Setting, Getting, and Fetching Server-Side Parameters

Since Remote Config is really just being able to manage a key-value pair stored on the cloud, it is very versatile. We’ll learn about some of these different uses to grasp Remote Config’s fullest potential.

   •  Recap on how we’ve already been using Remote Config

   •  Learn about how Remote Config can be used to slowly roll out an update

   •  Learn about A/B Testing and its stems from Remote Config

Exploring Remote Config Use Cases
+ Responding to Key Events with Cloud Functions
3 lectures 11:08

We can’t respond to everything in our app. Fortunately, we can deploy functions on the cloud to respond to key events.

   •  Gain an overview of Firebase Cloud Functions

Introducing Firebase Cloud Functions

We need our function to trigger when the user first logs in. Unfortunately, we can’t use authentication’s trigger directly because we only want to trigger on the first time a user logs in, so we’ll explore a roundabout way of doing things

   •  Use npm to install the Firebase CLI and initialize the functions folder

   •  Use Firestore to store a messaging token

   •  Create the sendWelcomeMessage function trigger

Trigger – User’s First Log In

Now that we have our trigger, we can start filling out our function to send our users a welcome message when they first log in using Cloud Messaging.

   •  Compare Firestore data and get the messaging token

   •  Construct the message payload and send the message

   •  Deploy the function using the Firebase CLI

Execution – Send Them a Welcome Message
+ Effective Testing and Debugging
7 lectures 20:21

Let’s be real. The average developer spends much more time debugging than developing. It’s unavoidable. Fortunately, Crashlytics can save us hours of debugging by helping us deal with bugs more efficiently.

   •  Gain an overview of Firebase Analytics

Introducing Firebase Crashlytics

Crashlytics is Firebase’s crash reporting service, and it would be a mistake to develop or produce an app without one. The amount of time it can save is invaluable with the ability to pinpoint the exact location of a crash or gather information leading to it.

   •  Enable Crashlytics using the Fabric plugin

   •  Import the Dependencies

   •  Test it by forcing a crash

Setting Up Crashlytics

Crashlytics offers a lot already in its default setup, but there are ways to leverage it even further. With a little extra code, we can go even further into that debugging time saving.

   •  Add logs, key-value pairs, and UID data to precede an expected crash

   •  Review this data on the Firebase Console

   •  Log non-fatal bugs with Crashlytics.logException

Customizing Crash Reports

There are so many different Android devices our users could potentially be using. Testing for even a good percentage would normally be a huge pain. With Test Lab however, we can utilize Google’s lab of devices and test our app on them.

   •  Gain an overview of Firebase Test Lab

Introducing Firebase Test Lab

A Robo Test is an automated test that scans rapidly through our app. We’ll learn how to run one efficiently so that we can gain some insight about how our app runs on different devices.

   •  Build an APK and upload it to the Firebase Console

   •  Run the test on a selection of devices and versions.

   •  Once complete, review the test and check for any errors

Simultaneous Device Robo Testing

We might want to gain some insight about what our users want in our app. An A/B Test will allow us to serve different configurations to different groups of our users and analyze different metrics including user engagement and retention.

   •  Create the test in the Firebase Console

   •  Set the different variants and their configurations

   •  Set a goal and other metrics to track

Conducting A/B Tests

We’ve completed everything. We know now how to integrate a majority of Firebase’s different tools and services, and we now also have our finished value list. We’ll close up by going through a quick recap of how we’ve done everything thus far.

   •  Go through a recap of what we’ve done

   •  Celebrate good times

Our Finished Value List
  • Developers taking this course need to have a basic understanding of building apps with XML and Java.

Building a successful app needs a backend platform to store your users' data, which is taxing and inefficient if you try to create your own. There are so many devices that would take you forever if you tried to test your app on them. You will waste time fixing bugs affecting your app and it's almost impossible to tailor your app to each user's needs.

This course starts by explaining the features and benefits of using Firebase as a backend. Firebase is a seamless way to connect your app to the cloud. This way, your app can access its various tools and services—for example, its databases (to create an easy backend) and its crash reporting services, to save you plenty of time debugging. This course will help you build a to-do list application that rewards users with value points for completing tasks, allowing them to reap rewards such as special features as they get more tasks done. You'll also be able to access a PC version of the app to add and remove items, which will update on all platforms in real-time. You'll even be able to send alerts from the PC to the Android version of the app, even if the app hasn't yet been opened on Android, to make sure important tasks never go unchecked.

By the end of the course, you will be able to implement Firebase and its different tools and services in any app. You will be trained to think from the perspective of your users, build the right backends to support their needs, and run effective tests to make sure the features you build are successful.

About the Author

Eric Decanini is a Firebase developer who immerses himself in too much coffee for his own good and implements backend solutions using Firebase in Android and in AngularJS with the goal of sparking User Engagement through the cloud. He works as a freelancer implementing Firebase backends and services in Android applications and manages a Firebase blog.

At the tender age of 16, he took the role of lead developer to create a School Planner app: Classify. Now he works towards his goal of meeting new people and transforming dull, boring work into a balance of enjoyment that feels like the good days of college… but with more coffee of course.

Who this course is for:
  • This course is for Android developers or freelancers who want to take advantage of the power of a backend connected to the cloud and make their app experience efficient.
  • If you are looking for a way to get your app online and utilize powerful tools and services to provide a great user experience with Firebase, this course is for you!