Database Connection: Firebase Flashcards

1
Q

What services are offered by firebase

A

Firebase is a mobile platform that offers services that include: Analytics, Authentication, Realtime Database, Cloud
Firestore, Cloud Storage for Firebase, Cloud Functions for
Firebase, Firebase ML, Crashlytics, Performance Monitoring, Test Lab, App Distribution, Cloud Messaging, In-App Messaging, Remote Config, Dynamic Links, and AdMob.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Give a brief history of firebase

A

● Firebase started off as Envolve, a startup by James Tamplin and Andrew Lee in 2011.
● Envolve initially specialized as an API to integrate online chat functionality.
● After realization by the owners that Firebase was being used by
developers to pass application data, Firebase was started as a separate company in the same year and released in April to the public.
● The initial service Firebase offered was Realtime Database (a functionality that Firebase is mostly popular for among developers), but eventually, it
accommodated more services.
● Google acquire Firebase in October 2014, and merged it with Divshot, another company the bought in October 2015. Divshot specialized in HTML5 web-hosting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe firebase realtime database

A

● Firebase’s realtime database is a cloud-hosted database that stores and sync’s data using NoSQL.
● The data stored remains available even when the
application is offline.
● Data is stored as JSON and synchronized in realtime to every connected client.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the capabilities of the firebase realtime database

A

● It is realtime
● It works even while the app is offline as it persists the data to disk, ensuring synchronization
happens once connectivity is reestablished
● Client devices can access the database with no need of using an application server
● It can scale across multiple databases (monetary subscription required)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the implementation path?

A

– Integrate the Firebase Realtime Database SDKs
– Create Realtime Database references
– Set Data and Listen for Changes
– Enable Offline Persistence
– Secure your data using Firebase Realtime Database Security Rules

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the steps to connect your Android Application to Firebase

A

– Create a database
– Add the Realtime Database SDK to your application
– Configure the Realtime Database Rules
– Perform CRUD functionalities to your application

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the different starting modes for Firebase Security rules

A

– Test mode – recommended for getting started with mobile and web client (not so secure as anyone can read and overwrite your data)
– Locked mode – Denies all reads and writes from mobile and web clients

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the possible URLs when creating the databases

A

DATABASE_NAME.firebaseio.com (for databases in us-central1)
DATABASE_NAME.REGION.firebasedatabase.app (for databases in all other locations)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe and illustrate with code how to Add the Realtime Database SDK to your Application

A

● In your module (app-level) Gradle file (usually <project>/<appmodule>/build.gradle), add the dependency for the Realtime Database
Android library.
● Google recommends using the Firebase Android BoM to control library versioning and also use compatible versions of Firebase Android libraries.</appmodule></project>

*See page 9

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe the stage for configuring Realtime Database
Rules

A

● The Realtime Database provides a declarative rules language that allows you to define:
– how your data should be structured
– how it should be indexed, and
– when your data can be read from and written to.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe and illustrate with code how to write to a realtime database

A

Retrieve an instance of your database using getInstance() and reference the location you want
to write to.

*See page 11

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Describe and illustrate with code how to read from a realtime database

A

● To make your app data update in realtime, you should add a ValueEventListener to the
reference you just created.
● The onDataChange() method in this class is triggered once when the listener is attached
and again every time the data changes, including the children.

*See page 13

How well did you know this?
1
Not at all
2
3
4
5
Perfectly