SlideShare a Scribd company logo
Post IO Meetup
Introduction to Firebase
Amrit Sanjeev
Organizer, Blrdroid
Who am I ?
What is firebase
Realtime Database User Management Hosting
Realtime Application Platform
Real time database
● NoSQL, JSON database
● Maps each piece of data to a URL
● Pushes updates in milliseconds
when things change
● seemless offline support
● automatic sync on network
acccess
Offline support
● Automatically syncs to
the server and pushes
to other devices when
network comes back
Offline support
Drop-in support for login with
● Email & Password
● Common OAuth providers
○ Google
○ Facebook
○ Twitter
○ Github
● Your own custom auth tokens
Auth and user management
Static hosting
Production grade static-asset hosting service
● SSL Certificate included!
● Backed by a global CDN
● Launch with: firebase deploy
● One click rollbacks from our dashboard
Security Considerations
● Namespace sandboxing
● HTTPS + 2048-bit SSL
● BCrypt for passwords (not stored directly in the
Firebase)
● Security rules stored and executed server side
Reliability and Data retention
● SLA is 99.95%
● Check on status.firebase.com
● Consistency model guarantees write persistence
● Three tiered backups, every 24 hours
● Private customer backup to GCS/S3
Now let’s find out
how much code it is to
implement
Add firebase support
In build.gradle
dependencies {
compile 'com.firebase:firebase-client-android:2.3.0+'
}
In Android manifest
<uses-permission android:name="android.permission.INTERNET" />
In Android application or activity
@Override
public void onCreate() {
super.onCreate();
Firebase.setAndroidContext(this);
}
Data store
Creating a reference
Firebase rootRef = new Firebase("https://docs-examples.firebaseio.com/web/data");
Directly access child nodes in the data
Firebase rootRef = new Firebase("https://docs-examples.firebaseio.com/web/data/users/mchen/name");
Using the Child() api call
Firebase rootRef = new Firebase("https://docs-examples.firebaseio.com/web/data");
rootRef.child("users/mchen/name");
● setValue( ) Write or replace data to a defined path, like messages/users/<username>
● updateChildren( ) Update some of the keys for a defined path without replacing all of the data
● push( ) Add to a list of data in your Firebase database.
● runTransaction( ) Use our transactions feature when working with complex data
Firebase usersRef = ref.child("users");
Map<String, User> users = new HashMap<String, User>();
users.put("alanisawesome", alanisawesome);
users.put("gracehop", gracehop);
usersRef.setValue(users);
Saving data
Retrieving data
● Attach an asynchronous listener to a Firebase reference.
● The listener will be triggered
○ once for the initial state of the data
○ again anytime the data changes
Firebase ref = new Firebase("https://docs-examples.firebaseio.com/web/saving-data/fireblog/posts");
ref.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
System.out.println(snapshot.getValue());
}
@Override
public void onCancelled(FirebaseError firebaseError) {
System.out.println("The read failed: " + firebaseError.getMessage());
}
});
Offline support
Adding offline support
Firebase.getDefaultConfig().setPersistenceEnabled(true);
Keeping data refresh
Firebase scoresRef = new Firebase("https://dinosaur-facts.firebaseio.com/scores");
scoresRef.keepSynced(true);
Thank you!
Amrit Sanjeev
@amsanjeev
www.blrdroid.org

More Related Content

What's hot

Introduction, Examples - Firebase
Introduction, Examples - Firebase Introduction, Examples - Firebase
Introduction, Examples - Firebase
Eueung Mulyana
 
Intro firebase
Intro firebaseIntro firebase
Intro firebase
Mandy Pao
 
Firebase
FirebaseFirebase
Firebase
Manasa Mona
 
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Sittiphol Phanvilai
 
Getting Started with Firebase Cloud Functions
Getting Started with Firebase Cloud FunctionsGetting Started with Firebase Cloud Functions
Getting Started with Firebase Cloud Functions
Muhammad Samu
 
How to build Android Chat App with Firebase for 2 hours?
How to build Android Chat App with Firebase for 2 hours?How to build Android Chat App with Firebase for 2 hours?
How to build Android Chat App with Firebase for 2 hours?
Nguyễn Bá Thành
 
Firebase - realtime backend for mobile app and IoT
Firebase - realtime backend for mobile app and IoTFirebase - realtime backend for mobile app and IoT
Firebase - realtime backend for mobile app and IoT
Andri Yadi
 
Introducing firebase
Introducing firebaseIntroducing firebase
Introducing firebase
Farouk Touzi
 
Building Extraordinary Apps with Firebase Analytics
Building Extraordinary Apps with Firebase AnalyticsBuilding Extraordinary Apps with Firebase Analytics
Building Extraordinary Apps with Firebase Analytics
GDG Korea
 
Firebase Basics - Dialog Demo for Group Tech Staff
Firebase Basics - Dialog Demo for Group Tech StaffFirebase Basics - Dialog Demo for Group Tech Staff
Firebase Basics - Dialog Demo for Group Tech Staff
Tharaka Devinda
 
What is new in Firebase?
What is new in Firebase?What is new in Firebase?
What is new in Firebase?
Sinan Yılmaz
 
Online mobile game server use Firebase realtime aatabase
Online mobile game server use Firebase realtime aatabaseOnline mobile game server use Firebase realtime aatabase
Online mobile game server use Firebase realtime aatabase
Nguyễn Bá Thành
 
Introducing Firebase by Google
Introducing Firebase by GoogleIntroducing Firebase by Google
Introducing Firebase by Google
Algiers Tech Meetup
 
Firebase for the Web
Firebase for the WebFirebase for the Web
Firebase for the Web
Jana Moudrá
 
Firebase
FirebaseFirebase
Firebase
Shady Selim
 
Firebase
FirebaseFirebase
Firebase
neha nasreen
 
Firebase Adventures - Going above and beyond in Realtime
Firebase Adventures - Going above and beyond in RealtimeFirebase Adventures - Going above and beyond in Realtime
Firebase Adventures - Going above and beyond in Realtime
Juarez Filho
 
The Firebase tier for your mobile app - DevFest CH
The Firebase tier for your mobile app - DevFest CHThe Firebase tier for your mobile app - DevFest CH
The Firebase tier for your mobile app - DevFest CH
Matteo Bonifazi
 
What's New with Confluence Connect
What's New with Confluence ConnectWhat's New with Confluence Connect
What's New with Confluence Connect
Atlassian
 
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio StruyfO365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
NCCOMMS
 

What's hot (20)

Introduction, Examples - Firebase
Introduction, Examples - Firebase Introduction, Examples - Firebase
Introduction, Examples - Firebase
 
Intro firebase
Intro firebaseIntro firebase
Intro firebase
 
Firebase
FirebaseFirebase
Firebase
 
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]
 
Getting Started with Firebase Cloud Functions
Getting Started with Firebase Cloud FunctionsGetting Started with Firebase Cloud Functions
Getting Started with Firebase Cloud Functions
 
How to build Android Chat App with Firebase for 2 hours?
How to build Android Chat App with Firebase for 2 hours?How to build Android Chat App with Firebase for 2 hours?
How to build Android Chat App with Firebase for 2 hours?
 
Firebase - realtime backend for mobile app and IoT
Firebase - realtime backend for mobile app and IoTFirebase - realtime backend for mobile app and IoT
Firebase - realtime backend for mobile app and IoT
 
Introducing firebase
Introducing firebaseIntroducing firebase
Introducing firebase
 
Building Extraordinary Apps with Firebase Analytics
Building Extraordinary Apps with Firebase AnalyticsBuilding Extraordinary Apps with Firebase Analytics
Building Extraordinary Apps with Firebase Analytics
 
Firebase Basics - Dialog Demo for Group Tech Staff
Firebase Basics - Dialog Demo for Group Tech StaffFirebase Basics - Dialog Demo for Group Tech Staff
Firebase Basics - Dialog Demo for Group Tech Staff
 
What is new in Firebase?
What is new in Firebase?What is new in Firebase?
What is new in Firebase?
 
Online mobile game server use Firebase realtime aatabase
Online mobile game server use Firebase realtime aatabaseOnline mobile game server use Firebase realtime aatabase
Online mobile game server use Firebase realtime aatabase
 
Introducing Firebase by Google
Introducing Firebase by GoogleIntroducing Firebase by Google
Introducing Firebase by Google
 
Firebase for the Web
Firebase for the WebFirebase for the Web
Firebase for the Web
 
Firebase
FirebaseFirebase
Firebase
 
Firebase
FirebaseFirebase
Firebase
 
Firebase Adventures - Going above and beyond in Realtime
Firebase Adventures - Going above and beyond in RealtimeFirebase Adventures - Going above and beyond in Realtime
Firebase Adventures - Going above and beyond in Realtime
 
The Firebase tier for your mobile app - DevFest CH
The Firebase tier for your mobile app - DevFest CHThe Firebase tier for your mobile app - DevFest CH
The Firebase tier for your mobile app - DevFest CH
 
What's New with Confluence Connect
What's New with Confluence ConnectWhat's New with Confluence Connect
What's New with Confluence Connect
 
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio StruyfO365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
 

Similar to Introduction to Firebase on Android

Firebase-ized your mobile app
Firebase-ized  your mobile appFirebase-ized  your mobile app
Firebase-ized your mobile app
Matteo Bonifazi
 
Angular 4 with firebase
Angular 4 with firebaseAngular 4 with firebase
Angular 4 with firebase
Anne Bougie
 
Google Firebase presentation - English
Google Firebase presentation - EnglishGoogle Firebase presentation - English
Google Firebase presentation - English
Alexandros Tsichouridis
 
Firebase overview
Firebase overviewFirebase overview
Firebase overview
Maksym Davydov
 
Database, data storage, hosting with Firebase
Database, data storage, hosting with FirebaseDatabase, data storage, hosting with Firebase
Database, data storage, hosting with Firebase
Tu Pham
 
Lecture 11 Firebase overview
Lecture 11 Firebase overviewLecture 11 Firebase overview
Lecture 11 Firebase overview
Maksym Davydov
 
Firebase
Firebase Firebase
Firestore MENA digital days : GDG Abu dhabi
Firestore MENA digital days : GDG Abu dhabiFirestore MENA digital days : GDG Abu dhabi
Firestore MENA digital days : GDG Abu dhabi
Shashank Kakroo
 
Intro to Firebase || Event by DSC UNIDEB
Intro to Firebase || Event by DSC UNIDEBIntro to Firebase || Event by DSC UNIDEB
Intro to Firebase || Event by DSC UNIDEB
Muhammad Raza
 
Building an Android app with Jetpack Compose and Firebase
Building an Android app with Jetpack Compose and FirebaseBuilding an Android app with Jetpack Compose and Firebase
Building an Android app with Jetpack Compose and Firebase
Marina Coelho
 
Lessons learned using Firebase in Production
Lessons learned using Firebase in ProductionLessons learned using Firebase in Production
Lessons learned using Firebase in Production
Maik Buchmeyer
 
Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...
Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...
Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...
Codemotion
 
Firebase on Android: The Big Picture
Firebase on Android: The Big PictureFirebase on Android: The Big Picture
Firebase on Android: The Big Picture
Sriyank Siddhartha
 
JUDCon 2014: Gearing up for mobile development with AeroGear
JUDCon 2014: Gearing up for mobile development with AeroGearJUDCon 2014: Gearing up for mobile development with AeroGear
JUDCon 2014: Gearing up for mobile development with AeroGear
prajods
 
Backbone Conf 2014 - Realtime & Firebase
Backbone Conf 2014 - Realtime & FirebaseBackbone Conf 2014 - Realtime & Firebase
Backbone Conf 2014 - Realtime & Firebase
Clément Wehrung
 
Android writing and reading from firebase
Android writing and reading from firebaseAndroid writing and reading from firebase
Android writing and reading from firebase
Osahon Gino Ediagbonya
 
Mobile game architecture on GCP
Mobile game architecture on GCPMobile game architecture on GCP
Mobile game architecture on GCP
명근 최
 
Mobile App Development With IBM Cloudant
Mobile App Development With IBM CloudantMobile App Development With IBM Cloudant
Mobile App Development With IBM Cloudant
IBM Cloud Data Services
 
Developing For Multiple Environments on SharePoint Online
Developing For Multiple Environments on SharePoint OnlineDeveloping For Multiple Environments on SharePoint Online
Developing For Multiple Environments on SharePoint Online
Frank Sikorski
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5
Darren Craig
 

Similar to Introduction to Firebase on Android (20)

Firebase-ized your mobile app
Firebase-ized  your mobile appFirebase-ized  your mobile app
Firebase-ized your mobile app
 
Angular 4 with firebase
Angular 4 with firebaseAngular 4 with firebase
Angular 4 with firebase
 
Google Firebase presentation - English
Google Firebase presentation - EnglishGoogle Firebase presentation - English
Google Firebase presentation - English
 
Firebase overview
Firebase overviewFirebase overview
Firebase overview
 
Database, data storage, hosting with Firebase
Database, data storage, hosting with FirebaseDatabase, data storage, hosting with Firebase
Database, data storage, hosting with Firebase
 
Lecture 11 Firebase overview
Lecture 11 Firebase overviewLecture 11 Firebase overview
Lecture 11 Firebase overview
 
Firebase
Firebase Firebase
Firebase
 
Firestore MENA digital days : GDG Abu dhabi
Firestore MENA digital days : GDG Abu dhabiFirestore MENA digital days : GDG Abu dhabi
Firestore MENA digital days : GDG Abu dhabi
 
Intro to Firebase || Event by DSC UNIDEB
Intro to Firebase || Event by DSC UNIDEBIntro to Firebase || Event by DSC UNIDEB
Intro to Firebase || Event by DSC UNIDEB
 
Building an Android app with Jetpack Compose and Firebase
Building an Android app with Jetpack Compose and FirebaseBuilding an Android app with Jetpack Compose and Firebase
Building an Android app with Jetpack Compose and Firebase
 
Lessons learned using Firebase in Production
Lessons learned using Firebase in ProductionLessons learned using Firebase in Production
Lessons learned using Firebase in Production
 
Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...
Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...
Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...
 
Firebase on Android: The Big Picture
Firebase on Android: The Big PictureFirebase on Android: The Big Picture
Firebase on Android: The Big Picture
 
JUDCon 2014: Gearing up for mobile development with AeroGear
JUDCon 2014: Gearing up for mobile development with AeroGearJUDCon 2014: Gearing up for mobile development with AeroGear
JUDCon 2014: Gearing up for mobile development with AeroGear
 
Backbone Conf 2014 - Realtime & Firebase
Backbone Conf 2014 - Realtime & FirebaseBackbone Conf 2014 - Realtime & Firebase
Backbone Conf 2014 - Realtime & Firebase
 
Android writing and reading from firebase
Android writing and reading from firebaseAndroid writing and reading from firebase
Android writing and reading from firebase
 
Mobile game architecture on GCP
Mobile game architecture on GCPMobile game architecture on GCP
Mobile game architecture on GCP
 
Mobile App Development With IBM Cloudant
Mobile App Development With IBM CloudantMobile App Development With IBM Cloudant
Mobile App Development With IBM Cloudant
 
Developing For Multiple Environments on SharePoint Online
Developing For Multiple Environments on SharePoint OnlineDeveloping For Multiple Environments on SharePoint Online
Developing For Multiple Environments on SharePoint Online
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5
 

More from amsanjeev

No sql databases blrdroid devfest 2016
No sql databases   blrdroid devfest 2016No sql databases   blrdroid devfest 2016
No sql databases blrdroid devfest 2016
amsanjeev
 
Io13 deep dive location api
Io13 deep dive   location api Io13 deep dive   location api
Io13 deep dive location api amsanjeev
 
Jelly bean aka Andorid 4.1
Jelly bean aka Andorid 4.1Jelly bean aka Andorid 4.1
Jelly bean aka Andorid 4.1
amsanjeev
 
Mobile UX
Mobile UXMobile UX
Mobile UX
amsanjeev
 
Location Based Services - An Overview
Location Based Services - An Overview Location Based Services - An Overview
Location Based Services - An Overview amsanjeev
 
NFC - quick primer
NFC - quick primerNFC - quick primer
NFC - quick primeramsanjeev
 
Introduction to ICS
Introduction to ICSIntroduction to ICS
Introduction to ICS
amsanjeev
 

More from amsanjeev (7)

No sql databases blrdroid devfest 2016
No sql databases   blrdroid devfest 2016No sql databases   blrdroid devfest 2016
No sql databases blrdroid devfest 2016
 
Io13 deep dive location api
Io13 deep dive   location api Io13 deep dive   location api
Io13 deep dive location api
 
Jelly bean aka Andorid 4.1
Jelly bean aka Andorid 4.1Jelly bean aka Andorid 4.1
Jelly bean aka Andorid 4.1
 
Mobile UX
Mobile UXMobile UX
Mobile UX
 
Location Based Services - An Overview
Location Based Services - An Overview Location Based Services - An Overview
Location Based Services - An Overview
 
NFC - quick primer
NFC - quick primerNFC - quick primer
NFC - quick primer
 
Introduction to ICS
Introduction to ICSIntroduction to ICS
Introduction to ICS
 

Recently uploaded

Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 

Recently uploaded (20)

Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 

Introduction to Firebase on Android

  • 1. Post IO Meetup Introduction to Firebase Amrit Sanjeev Organizer, Blrdroid
  • 3.
  • 4. What is firebase Realtime Database User Management Hosting Realtime Application Platform
  • 5. Real time database ● NoSQL, JSON database ● Maps each piece of data to a URL ● Pushes updates in milliseconds when things change
  • 6. ● seemless offline support ● automatic sync on network acccess Offline support
  • 7. ● Automatically syncs to the server and pushes to other devices when network comes back Offline support
  • 8. Drop-in support for login with ● Email & Password ● Common OAuth providers ○ Google ○ Facebook ○ Twitter ○ Github ● Your own custom auth tokens Auth and user management
  • 9. Static hosting Production grade static-asset hosting service ● SSL Certificate included! ● Backed by a global CDN ● Launch with: firebase deploy ● One click rollbacks from our dashboard
  • 10. Security Considerations ● Namespace sandboxing ● HTTPS + 2048-bit SSL ● BCrypt for passwords (not stored directly in the Firebase) ● Security rules stored and executed server side
  • 11. Reliability and Data retention ● SLA is 99.95% ● Check on status.firebase.com ● Consistency model guarantees write persistence ● Three tiered backups, every 24 hours ● Private customer backup to GCS/S3
  • 12. Now let’s find out how much code it is to implement
  • 13. Add firebase support In build.gradle dependencies { compile 'com.firebase:firebase-client-android:2.3.0+' } In Android manifest <uses-permission android:name="android.permission.INTERNET" /> In Android application or activity @Override public void onCreate() { super.onCreate(); Firebase.setAndroidContext(this); }
  • 14. Data store Creating a reference Firebase rootRef = new Firebase("https://docs-examples.firebaseio.com/web/data"); Directly access child nodes in the data Firebase rootRef = new Firebase("https://docs-examples.firebaseio.com/web/data/users/mchen/name"); Using the Child() api call Firebase rootRef = new Firebase("https://docs-examples.firebaseio.com/web/data"); rootRef.child("users/mchen/name");
  • 15. ● setValue( ) Write or replace data to a defined path, like messages/users/<username> ● updateChildren( ) Update some of the keys for a defined path without replacing all of the data ● push( ) Add to a list of data in your Firebase database. ● runTransaction( ) Use our transactions feature when working with complex data Firebase usersRef = ref.child("users"); Map<String, User> users = new HashMap<String, User>(); users.put("alanisawesome", alanisawesome); users.put("gracehop", gracehop); usersRef.setValue(users); Saving data
  • 16. Retrieving data ● Attach an asynchronous listener to a Firebase reference. ● The listener will be triggered ○ once for the initial state of the data ○ again anytime the data changes Firebase ref = new Firebase("https://docs-examples.firebaseio.com/web/saving-data/fireblog/posts"); ref.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot snapshot) { System.out.println(snapshot.getValue()); } @Override public void onCancelled(FirebaseError firebaseError) { System.out.println("The read failed: " + firebaseError.getMessage()); } });
  • 17. Offline support Adding offline support Firebase.getDefaultConfig().setPersistenceEnabled(true); Keeping data refresh Firebase scoresRef = new Firebase("https://dinosaur-facts.firebaseio.com/scores"); scoresRef.keepSynced(true);