Book Image

Mastering Firebase for Android Development

By : Ashok Kumar S
Book Image

Mastering Firebase for Android Development

By: Ashok Kumar S

Overview of this book

Firebase offers a wide spectrum of tools and services to help you develop high-quality apps in a short period of time. It also allows you to build web and mobile apps quickly without managing the infrastructure.Mastering Firebase for Android Development takes you through the complete toolchain of Firebase,including the latest tools announced in Google IO 2018 such as Firebase ML-Kit, FireStore, and Firebase Predictions. The book begins by teaching you to configure your development environment with Firebase and set up a different structure for a Firebase real-time database. As you make your way through the chapters, you’ll establish the authentication feature in Android and explore email and phone authentication for managing the on-boarding of users. You’ll be taken through topics on Firebase crash reporting, Firebase functions, Firebase Cloud, Firebase Hosting, and Cloud Messaging for push notifications and explore other key areas in depth. In the concluding chapters, you will learn to use Firebase Test Lab to test your application before using Firebase Performance Monitoring to trace performance setbacks. By the end of the book, you will be well equipped with the Firebase ecosystem, which will help you find solutions to your common application development challenges.
Table of Contents (23 chapters)
Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Preface
9
Application Usage Measuring and Notification, Firebase Analytics, and Cloud Messaging
11
Bringing Everyone on the Same Page, Firebase Invites, and Firebase App Indexing
12
Making a Monetary Impact and Firebase AdMob and AdWords
13
Flexible NoSQL and Cloud Firestore
14
Analytics Data, Clairvoyant, Firebase Predictions
Index

Index

A

  • AdMob
    • about / AdMob
    • Android Studio / Android Studio and initializing the SDK
    • SDK, initializing / Android Studio and initializing the SDK
    • reference / Android Studio and initializing the SDK
  • AdWords
    • about / Firebase AdWords
    • account, creating / Creating an AdWords account
    • reference / Creating an AdWords account
    • linking, to Firebase / Linking AdWords to Firebase
    • used, for app conversion / Tracking app conversions with Firebase
  • AdWords Editor
    • download link / Creating an AdWords account
  • Analytics Triggers / Analytics and Crashlytics Triggers
  • Android application
    • creating, Realtime Database used / Creating an Android application using Realtime Database
    • user interface design / User interface design
    • logic / Logic
  • Android projects
    • Firebase, configuring / Configuring Firebase in Android projects
  • Android Studio
    • using, with Test Lab / Test Lab with Android Studio
  • App Indexing
    • about / Firebase App Indexing
    • reference / Firebase App Indexing
    • public content indexing, enabling / Enabling public content indexing
    • personal content indexing, enabling / Enabling personal content indexing
    • user actions, logging / Logging user actions
  • automatic traces
    • App Startup / Automatic traces
    • App Background / Automatic traces
    • App Foreground / Automatic traces
    • Network Requests / Automatic traces

B

  • barcode scanning
    • ML Kit, setting up / Setting up ML Kit for barcode scanning 
  • Bitrise
    • reference / Firebase Test Lab
  • Buddy build
    • reference / Firebase Test Lab

C

  • CI systems
    • using, with Test Lab / Test Lab with CI systems
  • Cloud Firestore
    • about / Cloud Firestore
    • reference / Cloud Firestore
    • data, adding / Adding and managing data
    • data structure, selecting for project / Choosing a data structure for your Firestore project
    • used, for querying data / Querying data
    • offline data support / Offline data support
  • Cloud Firestore Triggers / Cloud Firestore Triggers, Specific documents, Creating a document, Updating documents, Deleting a document, Changes in a document
  • Cloud Functions
    • using, tools / Firebase Cloud Functions
    • development environment, setting up / Set up the development environment
    • connecting / Connecting Firebase cloud functions
  • Cloud Messaging
    • about / Cloud Messaging, Cloud Messaging explained
    • using, in Android / Firebase Cloud Messaging in Android
    • first notification, sending / Sending the first notification
    • notification, sending / Sending the first notification
  • Cloud Messaging, using in Android
    • about / Firebase Cloud Messaging in Android
    • device registration token, accessing / Accessing the device registration token 
  • Cloud Pub/Sub Triggers / Cloud Pub/Sub Triggers
  • Cloud Storage / Firebase a Cloud Storage
  • Cloud Storage Triggers / Cloud Storage Triggers
  • Continous Integration (CI) / Test Lab with CI systems
  • Crashlytics
    • about / Firebase Crash Reporting and Crashlytics, Firebase Crashlytics 
    • setup / Firebase Crashlytics setup and upgrading from Crash Reporting
    • upgrading, from Crash Reporting / Firebase Crashlytics setup and upgrading from Crash Reporting
    • Crash Reporting, migrating to / Migrating from Firebase Crash Reporting to Crashlytics
    • implementation, validating / Validating Crashlytics implementation
    • debug mode, enabling / Enabling Crashlytics debug mode
    • reports, customizing / Customizing Crashlytics reports
    • and functions / Crashlytics and functions
  • Crashlytics Trigger / Analytics and Crashlytics Triggers
  • Crash Reporting
    • about / Firebase Crash Reporting and Crashlytics
    • setup / Firebase Crash Reporting setup 
    • custom logs, creating / Creating custom logs
    • ProGuard labels, deobfuscating / Deobfuscating ProGuard labels
    • support for multiple APK / Crash Report support for multiple APK
    • disabling / Disabling Crash Reporting
    • Crashlytics, upgrading from / Firebase Crashlytics setup and upgrading from Crash Reporting
  • crash reports
    • creating / Creating crash reports
  • custom attributes, monitoring
    • about / Monitoring custom attributes
    • Logcat output, enabling / Enabling Logcat output
  • custom domain
    • connecting to / Connecting to custom domain
  • custom models / Custom models 

D

  • data
    • querying / Querying data
    • securing / Securing data
  • database rules
    • types / Database rules and types
    • data validation rules / Database rules and types
    • indexing rules / Database rules and types
    • customizing / Customizing database rules
    • data security / Data security
  • default variables
    • auth / Default variables
    • now / Default variables
    • data / Default variables
    • newData / Default variables
    • root / Default variables
    • RuleDataSnapshot, methods / RuleDataSnapshot and its methods
  • development environment
    • prerequisites / Prerequisites 
    • Firebase, configuring in Android projects / Configuring Firebase in Android projects
  • development environment, Cloud Functions
    • setting up / Set up the development environment
    • reference / Set up the development environment
    • project structure / Project structure
    • required modules / Required modules
    • project, deploying / Deploying Cloud functions project
    • custom logs / Custom logs and reviewing functions
    • functions, reviewing / Custom logs and reviewing functions
  • Dynamic Links
    • about / Firebase Dynamic Links
    • use cases / Dynamic Links use cases
    • anatomy / The anatomy of Dynamic Links
    • creating / Creating Dynamic Links
    • receiving / Receiving Dynamic Links
  • Dynamic Links, use cases
    • mobile web users, converting to native app users / Converting mobile web users to native app users
    • content, sharing between users / Sharing content between users
    • reward referrals, using Firebase / Rewarding referrals using Firebase 

F

  • Facebook login service, FirebaseUI
    • Facebook App ID / Facebook App ID and App secret
    • App secret / Facebook App ID and App secret
    • reference / Facebook App ID and App secret
    • about / Facebook App ID and App secret
    • project configuration / Project configuration
  • face detection
    • ML Kit, setting up for / Setting up ML Kit for face detection
  • file metadata
    • about / File metadata
    • retrieving / Retrieving File Metadata
    • updating / Update the metadata of the file
    • files, deleting / Deleting files
    • common errors, handling / Handling common errors
    • security and rules / Security and rules
  • files
    • downloading / Uploading and downloading files, Downloading files 
    • existing files, uploading / Uploading existing files
    • uploading, as stream / Uploading files as a stream
    • form data, uploading in memory / Uploading from data in memory
    • upload, managing / Managing file upload
    • upload, monitoring / Monitoring file upload
    • monitoring and managing / Beyond monitoring and managing 
    • reference, creating / Creating a reference
    • downloading, into memory / Downloading into memory
    • downloading, into local file / Downloading into a local file
    • data, downloading through URL / Downloading data through a URL 
    • images, downloading with FirebaseUI / Downloading images using FirebaseUI
    • downloading, issues / Beyond downloading files
  • Firebase
    • development environment , setting up / Setting up a development environment 
    • configuring, in Android projects / Configuring Firebase in Android projects
    • reference / Configuring Firebase in Android projects
  • Firebase Analytics
    • about / Firebase Analytics
    • using, for Android / Firebase Analytics for Android
  • Firebase Analytics, using for Android
    • about / Firebase Analytics for Android
    • user properties, setting / Setting user properties
    • using, in WebView / Analytics in a WebView
    • events, debugging / Debugging events
    • functions / Firebase Analytics and functions
  • Firebase Authentication
    • about / Firebase Authentication
    • setting up / Setting up Firebase Authentication
    • FirebaseUI Auth / FirebaseUI Auth authentication
    • Firebase SDK / Firebase SDK Authentication
    • failures / Firebase Authentication failures
  • Firebase Authentication Triggers / Firebase Authentication Triggers
  • FireBase Console
    • reference / The general syntax for storage security rules, Server-side parameters
    • using, with Test Lab / Test Lab with Firebase Console
    • using, for performance monitoring / Firebase Console for Performance Monitoring
  • Firebase functions
    • writing / Writing Firebase functions
    • Cloud Functions, for firing push notification / Cloud Functions to fire a push notification
  • Firebase Hosting / Firebase Hosting
  • FireBase Invites
    • receiving, from Android applications / Sending and receiving invites from Android applications 
  • Firebase Invites
    • receiving, from Android applications / Sending and receiving invites from Android applications 
    • sending, from Android applications / Sending and receiving invites from Android applications 
    • reference / Sending and receiving invites from Android applications 
  • Firebase Predictions
    • about / Firebase Predictions 
    • cards / Firebase Predictions 
    • events, metrics / Firebase Predictions 
    • setting up / Setting up Firebase Predictions
    • monetization, optimizing / Optimizing monetization
    • promotions, optimizing / Optimizing promotions
    • churn, preventing / Preventing churn
    • predefined predictions / Predefined predictions
    • and risk tolerance / Predictions and risk tolerance
  • Firebase Realtime Database
    • writing to / Reading and writing to Realtime Database
    • rules / Realtime Database rules
  • Firebase SDK social networking site authentication
    • Google sign-in method / Google sign-in 
    • Facebook login method / Facebook login
    • Twitter sign-in method / Twitter sign-in 
    • phone number sign-in method / Phone number sign-in 
    • Anonymous Authentication method / Anonymous Authentication
    • multiple Auth providers, linking / Link multiple Auth providers
    • failures / Firebase Authentication failures
  • Firebase Storage
    • using / Firebase Storage in practice 
  • FirebaseUI Email Authentication
    • about / FirebaseUI Email Authentication
    • configuring, for Email Authentication / Configuring for Email Authentication
    • Email/Password Authentication, enabling in Console / Enabling Email/Password Authentication in Console
    • initializing / Initializing Firebase Authentication
    • project, finalizing / Finalizing the project
  • FirebaseUI social networking site Authentication
    • about / FirebaseUI social networking site authentication
    • Google Sign-in / Google Sign-in
    • Facebook login / Facebook Login
    • Twitter sign-in method / Twitter Sign-in
    • phone number sign-in method / Phone number sign-in
  • functions
    • triggering / Trigger functions 

G

  • game loop testing, Test Lab
    • about / Firebase Test Lab Game Loop testing 
    • Test Loop Manager, using / Test Loop Manager
    • project, creating / Game loop in Test Lab
  • gcloud CLI
    • reference / Test Lab with gcloud CLI 
    • using, with Test Lab / Test Lab with gcloud CLI 
  • Google Cloud Platform (GCP) / Firebase ML Kit
  • Google Sign-in, FirebaseUI
    • about / Google Sign-in
    • SHA-1 fingerprint / SHA-1 fingerprint
    • code, for Google provider / Code for Google provider

H

  • hosting behavior customization
    • about / Customizing hosting behavior
    • redirects / Redirects
    • rewrites, using / Rewrites 
    • headers / Headers 
    • hosting priorities / Hosting priorities
  • HTTP Triggers / HTTP Triggers

M

  • ML Kit
    • about / Firebase ML Kit
    • reference / Firebase ML Kit
    • setting up, for text recognition / Setting up ML Kit for recognizing text
    • setting up, for face detection / Setting up ML Kit for face detection
    • setting, up for barcode scanning / Setting up ML Kit for barcode scanning 
    • text recognition / ML Kit and text recognition 
  • ML Kit Vision
    • about / Vision
    • text, recognizing / Recognizing text
    • face detection / Face detection
    • barcode scanning / Barcode scanning 
  • ML Text
    • text recognition / ML Kit and text recognition 

N

  • Node.js
    • reference / Deploying a website

P

  • performance monitoring
    • about / Firebase Performance Monitoring
    • for Android / Performance Monitoring for Android
    • custom trace / Custom trace and counters
    • counters / Custom trace and counters
    • for Android performance / Performance Monitoring for Android performance
    • custom attributes, monitoring / Monitoring custom attributes
  • performance monitoring, for Android
    • steps / Performance Monitoring for Android
    • automatic traces / Automatic traces
  • phone number sign-in method, FirebaseUI
    • about / Phone number sign-in
    • project configuration / Project configuration
  • Plain Old Java Object (POJO) class / User interface design
  • prelaunch reports / Prelaunch reports 

R

  • Realtime Database
    • about / Firebase Realtime Database
    • reading to / Reading and writing to Realtime Database
    • database reference / Database reference 
    • writing into / Writing into Realtime Database
    • reading from / Reading from Realtime Database
    • data, structuring with objects / Structuring the data with objects
    • objects, reading from / Reading the objects from Firebase
    • value changes, reading / Reading value changes 
    • DataSnapshot object, parsing / Parsing the DataSnapshot object
    • data, updating / Updating data
    • HashMaps, writing to Realtime database / Writing HashMaps to Realtime Database
    • and lists / Realtime Database and lists
    • data, deleting / Deleting data
    • data, offline capabilities / Offline capabilities
    • used, for creating Android application / Creating an Android application using Realtime Database
  • Realtime Database Triggers / Realtime Database Triggers 
  • Remote Config
    • about / Firebase Remote Config
    • setting up, for Android / Setting up Remote Config on Android
    • A/B testing, using with / A/B Testing with Remote Config
  • Remote Config, setting up for Android
    • about / Setting up Remote Config on Android
    • singleton object / Remote Config's singleton object
    • in-app parameters / In-app parameters
    • parameters, accessing / Accessing the Remote Config parameters
    • server-side parameters / Server-side parameters
    • parameters, fetching / Fetching the parameters
    • parameters, activating / Activating parameters
    • rules / Conditions, rules, and values
    • conditions / Conditions, rules, and values
    • values / Conditions, rules, and values
    • Google Analytics / Remote Config and Google Analytics
  • Representational State Transfer (REST) / Database reference 
  • reserved URLs / Reserved URLs
  • risk tolerance, levels
    • high-risk / Predictions and risk tolerance
    • medium-risk / Predictions and risk tolerance
    • low-risk / Predictions and risk tolerance
  • rules, Firebase Realtime Database
    • about / Realtime Database rules
    • default security rules / Default security rules
    • database rules and types / Database rules and types
    • custom variables / Custom variables 
    • default variables / Default variables

S

  • SDK Email Authentication
    • about / Firebase SDK Email Authentication
    • new users, signing up / Sign up new users
    • existing users, signing in / Sign in existing users
    • users, managing / Managing users
    • users, managing through console / Managing users through console
  • security
    • rules / Security and rules
    • security rules, general syntax / The general syntax for storage security rules
    • user files, securing / Securing user files
    • Request and Resource Evaluation / Request and Resource Evaluation 
  • storage
    • and functions / Storage and functions 
  • storage reference
    • creating / Creating storage reference
    • properties / Storage reference properties
    • limitations / Limitations of reference

T

  • Test Lab
    • about / Firebase Test Lab
    • for Android / Test Lab for Android
    • Firebase Console, using / Test Lab with Firebase Console
    • using, with FireBase / Test Lab with Firebase Console
    • using, with gcloud CLI / Test Lab with gcloud CLI 
    • using, with CI systems / Test Lab with CI systems
    • using, with Android Studio / Test Lab with Android Studio
    • results / Firebase Test Lab results
    • available device list / Available devices in Test Lab
    • game loop testing / Firebase Test Lab Game Loop testing 
    • prelaunch reports / Prelaunch reports 
  • Test Lab, for Android
    • about / Test Lab for Android
    • testing method, selecting / Choosing the testing method
    • Robo test, playing out / Robo testing 
    • device type, selecting / Choosing device type and reviewing test results
    • test results, reviewing / Choosing device type and reviewing test results
  • Test Lab, using with CI systems
    • about / Test Lab with CI systems
    • global security settings, configuring / Test Lab with CI systems
    • Jenkins project, creating / Creating a Jenkins project 
  • Test Lab, using with gcl CLI
    • test configurations, selecting / Choosing test configurations
    • gcloud commands, scripting / Scripting gcloud commands with Test Lab
  • text recognition
    • about / Recognizing text
    • ML Kit, setting up for / Setting up ML Kit for recognizing text
    • on-device text recognition / On-device text recognition
    • Cloud-Based text recognition / Cloud-Based text recognition
    • ML Kit / ML Kit and text recognition 
  • triggers
    • about / Trigger functions 
    • Cloud Firestore Triggers / Cloud Firestore Triggers
    • Realtime Database Triggers / Realtime Database Triggers 
    • Firebase Authentication Triggers / Firebase Authentication Triggers
    • Analytics Trigger / Analytics and Crashlytics Triggers
    • Crashlytics Triggers / Analytics and Crashlytics Triggers
    • Cloud Storage Triggers / Cloud Storage Triggers
    • HTTP Triggers / HTTP Triggers
    • Cloud Pub/Sub Triggers / Cloud Pub/Sub Triggers
  • Twitter Sign-in method, FirebaseUI
    • about / Twitter Sign-in
    • Twitter Api key / Twitter Api key
    • reference / Twitter Api key
    • project configuration / Project Configuration

U

  • user actions, App Indexing
    • logging / Logging user actions
    • implementations, testing / Testing your implementation
    • latest APIs / Search performance and latest APIs
    • search performance / Search performance and latest APIs
    • reference / Search performance and latest APIs
  • user management
    • about / Managing users
    • provider-specific user profile details / Provider-specific user profile details
    • profile / Profile updating
    • verification email, sending / Sending a verification Email 
    • forgot password notification / Forgot password
    • user, deleting / Deleting a user
    • through console / Managing users through console
    • Smart Lock / Smart Lock 

W

  • website
    • deploying / Deploying a website