Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Firebase for Android Development

You're reading from   Mastering Firebase for Android Development Build real-time, scalable, and cloud-enabled Android apps with Firebase

Arrow left icon
Product type Paperback
Published in Jun 2018
Publisher Packt
ISBN-13 9781788624718
Length 394 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ashok Kumar S Ashok Kumar S
Author Profile Icon Ashok Kumar S
Ashok Kumar S
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Keep It Real – Firebase Realtime Database FREE CHAPTER 2. Safe and Sound – Firebase Authentication 3. Safe and Sound – Firebase Crashlytics 4. Genie in the Cloud – Firebase Cloud Functions 5. Arsenal for Your Files – Firebase Cloud Storage 6. Not Just a Keeper, Firebase Hosting 7. Inspection and Evaluation – Firebase Test Lab 8. A Smart Watchdog – Firebase Performance Monitoring 9. Application Usage Measuring and Notification, Firebase Analytics, and Cloud Messaging 10. Changing Your App – Firebase Remote Config and Dynamic Links 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 15. Training Your Code and ML Kit 16. Other Books You May Enjoy

Setting up a development environment 

To get started, we need to integrate the Firebase SDK to the project, and it is a one-time integration. Later, we can choose any of the Firebase tools that we want to work with and add the appropriate gradle dependency. 

Prerequisites 

To develop Firebase applications, you can surely use your development environment; the essential requirements are as follows:

  1. Your favorite operating system (Windows, macOS, or Linux)
  2. Determine whether you have the latest JRE installed on your operating system
  3. Install the latest version of JDK or Open JDK
  4. Install the newest version of Android Studio (at the time of writing, the most recent stable version is 2.3.3 and 3.0 is still in beta, or any newer version should also be excellent)
  5.  Android SDK with one complete API will be very significant
Before we continue to create our first Firebase Realtime Database Android application, ensure that you have one complete version of Android API installed, and you have the latest version of Android Studio.

Configuring Firebase in Android projects

There are two ways that you can connect Firebase to your Android project, from the Firebase console creating the new project and adding the dependencies and Google config file. The other way is just to add Firebase support to an Android project directly from Android Studio:

  1. The usual way of connecting Firebase is to visit the Firebase console at https://console.firebase.google.com/
  2. Create a new project using the Add Project button, and if you already have an existing project, you are free to choose it
  3. In the overview section of the console, you can choose to add an Android application by clicking on the relevant button and add the necessary information to the fields
  4. Download the google-services.json file, add it to your project's app folder root, and the classpath gradle dependencies in the project's gradle file
  5. To reduce the effort, we can make Android Studio do all this for us by choosing the Tools Firebase menu option and clicking on the Firebase tools that you want to integrate from the list
  6. After you chose the Firebase tool, tap on Save and retrieve data
  7. In the next window panel, you will see options such as Launch in the browserConnect your app to Firebaseand so on, click on the Connect your app to Firebase button and select your project or you can create the new project in the Connect to Firebase window
  8. Go back to the Firebase panel and click on the Add the Realtime Database to your application button

Since we have connected to Firebase, it is as simple as it sounds, all we have to do is select the Add the Realtime Database to your application button in the Firebase assistance window, you will see a dialog for requesting your authorization to change the gradle file with a few dependencies. Tap on Accept Changes, now we are all set to explore Realtime Database abilities.

You have been reading a chapter from
Mastering Firebase for Android Development
Published in: Jun 2018
Publisher: Packt
ISBN-13: 9781788624718
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image