SlideShare a Scribd company logo
Firebase-ized
your mobile app
Matteo Bonifazi
@mbonifazi
Firebase-ized  your mobile app
Who I am
● Android developer since Eclair
● GDE...what else? A beer addicted
● I hate Outlook & Jira notifications
My best quote: Day by day is the best way
Firebase-ized  your mobile app
Firebase-ized  your mobile app
Firebase-ized  your mobile app
Firebase-ized  your mobile app
Firebase-ized  your mobile app
Firebase-ized  your mobile app
Firebase-ized  your mobile app
Cross-platform
C++ and Unity compliant
Everything is integrated
Firebase-ized  your mobile app
❏ Account management
❏ Synch & conflict resolution
❏ Out of the box UI
❏ Compatible with most common accounts
Firebase Autenthication
Firebase Autenthication
User features Identity providers
● Google
● Facebook
● Twitter
● Github
● Represents the account signed in
the app
● Fixed set of basic properties
● Additional custom properties via
Realtime database
● Firebase Auth instance persists
the user's state
How Bring-Your-Own Auth works
Your Server Firebase Auth Server Firebase SDKs
1 User signs in using any
method (password,
Facebook, phone #)
Authenticate
with your server
2 Mint a “custom
Token”
3 Exchange custom
token for Firebase
Token
4 5 Authenticate
your users with
other Firebase
SDKs, without
replacing your
auth system
Custom
Firebase
Firebase-ized  your mobile app
compile 'com.google.firebase:firebase-auth:11.6.2
// Initialize Firebase Auth
FirebaseAuth mFirebaseAuth = FirebaseAuth.getInstance();
FirebaseUser mFirebaseUser = mFirebaseAuth.getCurrentUser();
if (mFirebaseUser == null) {
// Not signed in, launch the Sign In activity
…..
} else {
mUsername = mFirebaseUser.getDisplayName();
if (mFirebaseUser.getPhotoUrl() != null) {
mPhotoUrl = mFirebaseUser.getPhotoUrl().toString();
}
}
Log.d(TAG, "firebaseAuthWithGooogle:" + acct.getId());
AuthCredential credential = GoogleAuthProvider.getCredential(.....);
mFirebaseAuth.signInWithCredential(credential)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
….
public void onComplete(@NonNull Task<AuthResult> task) {
Log.d(TAG, "signInWithCredential:onComplete:" + task.isSuccessful());
Firebase-ized  your mobile app
❏ Easy scalable file storage
❏ Handles poor connectivity
❏ Backed by & accessible from
Google Cloud Storage
Firebase Storage
Firebase Storage keylines
● Firebase Storage performs uploads and downloads
regardless of network quality.
● Integrates seamlessly with Firebase Authentication to
identify users.
● Provides a declarative security language.
● Files stored in Google Cloud Platform - No Firebase Realtime
Database.
Firebase Storage - Storage security rules
● determine who has read and write access to files stored
● determinate how files are structured and what metadata
they contain
● Rules: the allow rule, which allows read and write operations
// Grants a user access to a node matching their user ID
service firebase.storage
{
match /b/<your-firebase-storage-bucket>/ {
// Files look like: "user/<UID>/path/to/file.txt"
match /user/{userId}/{allPaths=**} {
allow read, write: if request.auth.uid == userId;
}
}
}
compile 'com.google.firebase-storage:11.6.2
// Create a storage reference from our app
StorageReference storageRef = storage.getReference();
// Create a reference to "mountains.jpg"
StorageReference mountainsRef = storageRef.child("mountains.jpg");
// Create a reference to 'images/mountains.jpg'
StorageReference mountainImagesRef = storageRef.child("images/mountains.jpg");
// While the file names are the same, the references point to different files
mountainsRef.getName().equals(mountainImagesRef.getName()); // true
mountainsRef.getPath().equals(mountainImagesRef.getPath()); // false
islandRef = storageRef.child("images/island.jpg");
File localFile = File.createTempFile("images", "jpg");
islandRef.getFile(localFile).....
Firebase-ized  your mobile app
❏ Cloud-hosted NoSQL database
❏ Synch & conflict resolution
❏ Access directly from the app
❏ Freemium service
Firebase
Realtime Database
Realtime
Firebase Realtime Database Keylines
Offline
No networking code
Firebase Realtime Database Structured Data
“Kale” “Kale”
Realtime Event Realtime Event
listRef.push(“Kale”);
Firebase Realtime Database Security Rules
● Define:
○ how your data should be structured
○ when data can be read from or written to
● Rules type:
○ .read: Describes if and when data is allowed to be read by users
○ .write: Describes if and when data is allowed to be written.
○ .indexOn: Specifies a child to index to support ordering and querying.
○ .validate: Defines what a correctly formatted value will look like
Firebase Realtime Database Security Rules
● Security overview:
○ Authentication: control access to database
○ Authorization: control access to data
○ Data validation: check data consistency
○ Indexes: define indexes for ordering and querying the data
compile 'com.google.firebase-database:11.6.2
DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();
mDatabase.child("users").child(userId).child("username").setValue(name);
FirebaseDatabase.getInstance().setPersistenceEnabled(true);
Firebase-ized  your mobile app
❏ Cloud-hosted NoSQL database
❏ Synch & conflict resolution
❏ Access directly from the app
❏ Freemium service
Firebase Firestore
Firebase-ized  your mobile app
Firebase Firestore Data Model
● rooms
○ roomA
■ name : "my chat room"
■ messages
1. message1
a. from : "alex"
b. msg : "Hello
World!"
2. message2
■ ...
○ roomB
● ...
compile 'com.google.firebase-firestore:11.6.2
CollectionReference restaurants = mFirestore.collection("node - name");
restaurants.add(restaurant);
Firebase-ized  your mobile app
mFirestore = FirebaseFirestore.getInstance();
mQuery = mFirestore.collection("restaurants")
.orderBy("avgRating", Query.Direction.DESCENDING)
.limit(LIMIT);
Realtime Database Firestore
Firebase-ized  your mobile app
Cloud Firestore Triggers
// Listen for any change on document `matteo` in collection `users`
exports.myFunctionName = functions.firestore
.document('users/matteo).onWrite((event) => {
// Function code here
});
Firebase-ized  your mobile app
@mbonifazi
Ad

More Related Content

What's hot (20)

Amazon Cognito + Lambda + S3 + IAM
Amazon Cognito + Lambda + S3 + IAM Amazon Cognito + Lambda + S3 + IAM
Amazon Cognito + Lambda + S3 + IAM
Andriy Samilyak
 
Introducing MongoDB Atlas
Introducing MongoDB AtlasIntroducing MongoDB Atlas
Introducing MongoDB Atlas
MongoDB
 
Data Encryption - Azure Storage Service
Data Encryption - Azure Storage ServiceData Encryption - Azure Storage Service
Data Encryption - Azure Storage Service
Udaiappa Ramachandran
 
Server to Server API Security
Server to Server API SecurityServer to Server API Security
Server to Server API Security
Ganesh Ghag
 
google drive and the google drive sdk
google drive and the google drive sdkgoogle drive and the google drive sdk
google drive and the google drive sdk
firenze-gtug
 
Spring content negotiation
Spring content negotiationSpring content negotiation
Spring content negotiation
rahmanmds1
 
MongoDB Launchpad 2016: Moving Cybersecurity to the Cloud
MongoDB Launchpad 2016: Moving Cybersecurity to the CloudMongoDB Launchpad 2016: Moving Cybersecurity to the Cloud
MongoDB Launchpad 2016: Moving Cybersecurity to the Cloud
MongoDB
 
Microsoft Azure Identity and O365
Microsoft Azure Identity and O365Microsoft Azure Identity and O365
Microsoft Azure Identity and O365
Kris Wagner
 
Active Directory & LDAP | Security for Elasticsearch
Active Directory & LDAP | Security for ElasticsearchActive Directory & LDAP | Security for Elasticsearch
Active Directory & LDAP | Security for Elasticsearch
Jochen Kressin
 
MongoDB.local Berlin: MongoDB Mobile
MongoDB.local Berlin: MongoDB MobileMongoDB.local Berlin: MongoDB Mobile
MongoDB.local Berlin: MongoDB Mobile
MongoDB
 
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB
 
Event Sourcing your AngularJS applications
Event Sourcing your AngularJS applicationsEvent Sourcing your AngularJS applications
Event Sourcing your AngularJS applications
Maurice De Beijer [MVP]
 
MongoDB Stitch Introduction
MongoDB Stitch IntroductionMongoDB Stitch Introduction
MongoDB Stitch Introduction
MongoDB
 
Managing Cloud Security Design and Implementation in a Ransomware World
Managing Cloud Security Design and Implementation in a Ransomware WorldManaging Cloud Security Design and Implementation in a Ransomware World
Managing Cloud Security Design and Implementation in a Ransomware World
MongoDB
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB
 
MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...
MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...
MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...
MongoDB
 
MongoDB World 2018: Evolving your Data Access with MongoDB Stitch
MongoDB World 2018: Evolving your Data Access with MongoDB StitchMongoDB World 2018: Evolving your Data Access with MongoDB Stitch
MongoDB World 2018: Evolving your Data Access with MongoDB Stitch
MongoDB
 
Tutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB StitchTutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB Stitch
MongoDB
 
How Thermo Fisher is Reducing Data Analysis Times from Days to Minutes with M...
How Thermo Fisher is Reducing Data Analysis Times from Days to Minutes with M...How Thermo Fisher is Reducing Data Analysis Times from Days to Minutes with M...
How Thermo Fisher is Reducing Data Analysis Times from Days to Minutes with M...
MongoDB
 
Azure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template DeploymentAzure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template Deployment
Roy Kim
 
Amazon Cognito + Lambda + S3 + IAM
Amazon Cognito + Lambda + S3 + IAM Amazon Cognito + Lambda + S3 + IAM
Amazon Cognito + Lambda + S3 + IAM
Andriy Samilyak
 
Introducing MongoDB Atlas
Introducing MongoDB AtlasIntroducing MongoDB Atlas
Introducing MongoDB Atlas
MongoDB
 
Data Encryption - Azure Storage Service
Data Encryption - Azure Storage ServiceData Encryption - Azure Storage Service
Data Encryption - Azure Storage Service
Udaiappa Ramachandran
 
Server to Server API Security
Server to Server API SecurityServer to Server API Security
Server to Server API Security
Ganesh Ghag
 
google drive and the google drive sdk
google drive and the google drive sdkgoogle drive and the google drive sdk
google drive and the google drive sdk
firenze-gtug
 
Spring content negotiation
Spring content negotiationSpring content negotiation
Spring content negotiation
rahmanmds1
 
MongoDB Launchpad 2016: Moving Cybersecurity to the Cloud
MongoDB Launchpad 2016: Moving Cybersecurity to the CloudMongoDB Launchpad 2016: Moving Cybersecurity to the Cloud
MongoDB Launchpad 2016: Moving Cybersecurity to the Cloud
MongoDB
 
Microsoft Azure Identity and O365
Microsoft Azure Identity and O365Microsoft Azure Identity and O365
Microsoft Azure Identity and O365
Kris Wagner
 
Active Directory & LDAP | Security for Elasticsearch
Active Directory & LDAP | Security for ElasticsearchActive Directory & LDAP | Security for Elasticsearch
Active Directory & LDAP | Security for Elasticsearch
Jochen Kressin
 
MongoDB.local Berlin: MongoDB Mobile
MongoDB.local Berlin: MongoDB MobileMongoDB.local Berlin: MongoDB Mobile
MongoDB.local Berlin: MongoDB Mobile
MongoDB
 
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB
 
Event Sourcing your AngularJS applications
Event Sourcing your AngularJS applicationsEvent Sourcing your AngularJS applications
Event Sourcing your AngularJS applications
Maurice De Beijer [MVP]
 
MongoDB Stitch Introduction
MongoDB Stitch IntroductionMongoDB Stitch Introduction
MongoDB Stitch Introduction
MongoDB
 
Managing Cloud Security Design and Implementation in a Ransomware World
Managing Cloud Security Design and Implementation in a Ransomware WorldManaging Cloud Security Design and Implementation in a Ransomware World
Managing Cloud Security Design and Implementation in a Ransomware World
MongoDB
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB
 
MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...
MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...
MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...
MongoDB
 
MongoDB World 2018: Evolving your Data Access with MongoDB Stitch
MongoDB World 2018: Evolving your Data Access with MongoDB StitchMongoDB World 2018: Evolving your Data Access with MongoDB Stitch
MongoDB World 2018: Evolving your Data Access with MongoDB Stitch
MongoDB
 
Tutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB StitchTutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB Stitch
MongoDB
 
How Thermo Fisher is Reducing Data Analysis Times from Days to Minutes with M...
How Thermo Fisher is Reducing Data Analysis Times from Days to Minutes with M...How Thermo Fisher is Reducing Data Analysis Times from Days to Minutes with M...
How Thermo Fisher is Reducing Data Analysis Times from Days to Minutes with M...
MongoDB
 
Azure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template DeploymentAzure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template Deployment
Roy Kim
 

Similar to Firebase-ized your mobile app (20)

Introduction to Firebase on Android
Introduction to Firebase on AndroidIntroduction to Firebase on Android
Introduction to Firebase on Android
amsanjeev
 
Google Firebase presentation - English
Google Firebase presentation - EnglishGoogle Firebase presentation - English
Google Firebase presentation - English
Alexandros Tsichouridis
 
Fire up your mobile app!
Fire up your mobile app!Fire up your mobile app!
Fire up your mobile app!
Suganthi Giridharan
 
Firebase
Firebase Firebase
Firebase
Naveen Kumar Neelam
 
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODEMSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
annalakshmi35
 
Firebase .pptx
Firebase .pptxFirebase .pptx
Firebase .pptx
GDSCIIITDHARWAD
 
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
 
6 Things You Didn't Know About Firebase Auth
6 Things You Didn't Know About Firebase Auth6 Things You Didn't Know About Firebase Auth
6 Things You Didn't Know About Firebase Auth
Peter Friese
 
Five Things You Didn't Know About Firebase Auth
Five Things You Didn't Know About Firebase AuthFive Things You Didn't Know About Firebase Auth
Five Things You Didn't Know About Firebase Auth
Peter Friese
 
Firebase overview
Firebase overviewFirebase overview
Firebase overview
Maksym Davydov
 
Lecture 11 Firebase overview
Lecture 11 Firebase overviewLecture 11 Firebase overview
Lecture 11 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
 
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
 
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
 
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
 
MongoDB.local Berlin: App development in a Serverless World
MongoDB.local Berlin: App development in a Serverless WorldMongoDB.local Berlin: App development in a Serverless World
MongoDB.local Berlin: App development in a Serverless World
MongoDB
 
Intro to Firebase Realtime Database and Authentication
Intro to Firebase Realtime Database and AuthenticationIntro to Firebase Realtime Database and Authentication
Intro to Firebase Realtime Database and Authentication
kristinferrier
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
Dr. Mazin Mohamed alkathiri
 
Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)
Chris Adamson
 
What is new in Firebase?
What is new in Firebase?What is new in Firebase?
What is new in Firebase?
Sinan Yılmaz
 
Introduction to Firebase on Android
Introduction to Firebase on AndroidIntroduction to Firebase on Android
Introduction to Firebase on Android
amsanjeev
 
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODEMSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
annalakshmi35
 
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
 
6 Things You Didn't Know About Firebase Auth
6 Things You Didn't Know About Firebase Auth6 Things You Didn't Know About Firebase Auth
6 Things You Didn't Know About Firebase Auth
Peter Friese
 
Five Things You Didn't Know About Firebase Auth
Five Things You Didn't Know About Firebase AuthFive Things You Didn't Know About Firebase Auth
Five Things You Didn't Know About Firebase Auth
Peter Friese
 
Lecture 11 Firebase overview
Lecture 11 Firebase overviewLecture 11 Firebase overview
Lecture 11 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
 
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
 
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
 
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
 
MongoDB.local Berlin: App development in a Serverless World
MongoDB.local Berlin: App development in a Serverless WorldMongoDB.local Berlin: App development in a Serverless World
MongoDB.local Berlin: App development in a Serverless World
MongoDB
 
Intro to Firebase Realtime Database and Authentication
Intro to Firebase Realtime Database and AuthenticationIntro to Firebase Realtime Database and Authentication
Intro to Firebase Realtime Database and Authentication
kristinferrier
 
Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)
Chris Adamson
 
What is new in Firebase?
What is new in Firebase?What is new in Firebase?
What is new in Firebase?
Sinan Yılmaz
 
Ad

More from Matteo Bonifazi (17)

Invading the home screen
Invading the home screenInvading the home screen
Invading the home screen
Matteo Bonifazi
 
Engage user with actions
Engage user with actionsEngage user with actions
Engage user with actions
Matteo Bonifazi
 
Kotlin killed Java stars
Kotlin killed Java starsKotlin killed Java stars
Kotlin killed Java stars
Matteo Bonifazi
 
Android JET Navigation
Android JET NavigationAndroid JET Navigation
Android JET Navigation
Matteo Bonifazi
 
Backendless apps
Backendless appsBackendless apps
Backendless apps
Matteo Bonifazi
 
Android - Saving data
Android - Saving dataAndroid - Saving data
Android - Saving data
Matteo Bonifazi
 
Android Networking
Android NetworkingAndroid Networking
Android Networking
Matteo Bonifazi
 
Android - Displaying images
Android - Displaying imagesAndroid - Displaying images
Android - Displaying images
Matteo Bonifazi
 
Android - Background operation
Android - Background operationAndroid - Background operation
Android - Background operation
Matteo Bonifazi
 
Android things intro
Android things introAndroid things intro
Android things intro
Matteo Bonifazi
 
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
 
Engage and retain users in the android world - Droidcon Italy 2016
Engage and retain users in the android world - Droidcon Italy 2016Engage and retain users in the android world - Droidcon Italy 2016
Engage and retain users in the android world - Droidcon Italy 2016
Matteo Bonifazi
 
UaMobitech - App Links and App Indexing API
UaMobitech - App Links and App Indexing APIUaMobitech - App Links and App Indexing API
UaMobitech - App Links and App Indexing API
Matteo Bonifazi
 
The unconventional devices for the Android video streaming
The unconventional devices for the Android video streamingThe unconventional devices for the Android video streaming
The unconventional devices for the Android video streaming
Matteo Bonifazi
 
Google IO - Five months later
Google IO - Five months laterGoogle IO - Five months later
Google IO - Five months later
Matteo Bonifazi
 
Video Streaming: from the native Android player to uncoventional devices
Video Streaming: from the native Android player to uncoventional devicesVideo Streaming: from the native Android player to uncoventional devices
Video Streaming: from the native Android player to uncoventional devices
Matteo Bonifazi
 
Enlarge your screen
Enlarge your screenEnlarge your screen
Enlarge your screen
Matteo Bonifazi
 
Invading the home screen
Invading the home screenInvading the home screen
Invading the home screen
Matteo Bonifazi
 
Engage user with actions
Engage user with actionsEngage user with actions
Engage user with actions
Matteo Bonifazi
 
Kotlin killed Java stars
Kotlin killed Java starsKotlin killed Java stars
Kotlin killed Java stars
Matteo Bonifazi
 
Android - Displaying images
Android - Displaying imagesAndroid - Displaying images
Android - Displaying images
Matteo Bonifazi
 
Android - Background operation
Android - Background operationAndroid - Background operation
Android - Background operation
Matteo Bonifazi
 
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
 
Engage and retain users in the android world - Droidcon Italy 2016
Engage and retain users in the android world - Droidcon Italy 2016Engage and retain users in the android world - Droidcon Italy 2016
Engage and retain users in the android world - Droidcon Italy 2016
Matteo Bonifazi
 
UaMobitech - App Links and App Indexing API
UaMobitech - App Links and App Indexing APIUaMobitech - App Links and App Indexing API
UaMobitech - App Links and App Indexing API
Matteo Bonifazi
 
The unconventional devices for the Android video streaming
The unconventional devices for the Android video streamingThe unconventional devices for the Android video streaming
The unconventional devices for the Android video streaming
Matteo Bonifazi
 
Google IO - Five months later
Google IO - Five months laterGoogle IO - Five months later
Google IO - Five months later
Matteo Bonifazi
 
Video Streaming: from the native Android player to uncoventional devices
Video Streaming: from the native Android player to uncoventional devicesVideo Streaming: from the native Android player to uncoventional devices
Video Streaming: from the native Android player to uncoventional devices
Matteo Bonifazi
 
Ad

Recently uploaded (19)

5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx
andani26
 
project_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptxproject_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptx
redzuriel13
 
(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security
aluacharya169
 
Understanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep WebUnderstanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep Web
nabilajabin35
 
Computers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers NetworksComputers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers Networks
Tito208863
 
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 SupportReliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
steve198109
 
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry SweetserAPNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC
 
highend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptxhighend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptx
elhadjcheikhdiop
 
White and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptxWhite and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptx
canumatown
 
DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)
APNIC
 
Perguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolhaPerguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolha
socaslev
 
OSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description fOSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description f
cbr49917
 
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHostingTop Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
steve198109
 
Best web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you businessBest web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you business
steve198109
 
IT Services Workflow From Request to Resolution
IT Services Workflow From Request to ResolutionIT Services Workflow From Request to Resolution
IT Services Workflow From Request to Resolution
mzmziiskd
 
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
DataProvider1
 
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC
 
Determining Glass is mechanical textile
Determining  Glass is mechanical textileDetermining  Glass is mechanical textile
Determining Glass is mechanical textile
Azizul Hakim
 
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation TemplateSmart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
yojeari421237
 
5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx
andani26
 
project_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptxproject_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptx
redzuriel13
 
(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security
aluacharya169
 
Understanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep WebUnderstanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep Web
nabilajabin35
 
Computers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers NetworksComputers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers Networks
Tito208863
 
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 SupportReliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
steve198109
 
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry SweetserAPNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC
 
highend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptxhighend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptx
elhadjcheikhdiop
 
White and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptxWhite and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptx
canumatown
 
DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)
APNIC
 
Perguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolhaPerguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolha
socaslev
 
OSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description fOSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description f
cbr49917
 
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHostingTop Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
steve198109
 
Best web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you businessBest web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you business
steve198109
 
IT Services Workflow From Request to Resolution
IT Services Workflow From Request to ResolutionIT Services Workflow From Request to Resolution
IT Services Workflow From Request to Resolution
mzmziiskd
 
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
DataProvider1
 
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC
 
Determining Glass is mechanical textile
Determining  Glass is mechanical textileDetermining  Glass is mechanical textile
Determining Glass is mechanical textile
Azizul Hakim
 
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation TemplateSmart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
yojeari421237
 

Firebase-ized your mobile app

  • 3. Who I am ● Android developer since Eclair ● GDE...what else? A beer addicted ● I hate Outlook & Jira notifications My best quote: Day by day is the best way
  • 14. ❏ Account management ❏ Synch & conflict resolution ❏ Out of the box UI ❏ Compatible with most common accounts Firebase Autenthication
  • 15. Firebase Autenthication User features Identity providers ● Google ● Facebook ● Twitter ● Github ● Represents the account signed in the app ● Fixed set of basic properties ● Additional custom properties via Realtime database ● Firebase Auth instance persists the user's state
  • 16. How Bring-Your-Own Auth works Your Server Firebase Auth Server Firebase SDKs 1 User signs in using any method (password, Facebook, phone #) Authenticate with your server 2 Mint a “custom Token” 3 Exchange custom token for Firebase Token 4 5 Authenticate your users with other Firebase SDKs, without replacing your auth system Custom Firebase
  • 19. // Initialize Firebase Auth FirebaseAuth mFirebaseAuth = FirebaseAuth.getInstance(); FirebaseUser mFirebaseUser = mFirebaseAuth.getCurrentUser(); if (mFirebaseUser == null) { // Not signed in, launch the Sign In activity ….. } else { mUsername = mFirebaseUser.getDisplayName(); if (mFirebaseUser.getPhotoUrl() != null) { mPhotoUrl = mFirebaseUser.getPhotoUrl().toString(); } }
  • 20. Log.d(TAG, "firebaseAuthWithGooogle:" + acct.getId()); AuthCredential credential = GoogleAuthProvider.getCredential(.....); mFirebaseAuth.signInWithCredential(credential) .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { …. public void onComplete(@NonNull Task<AuthResult> task) { Log.d(TAG, "signInWithCredential:onComplete:" + task.isSuccessful());
  • 22. ❏ Easy scalable file storage ❏ Handles poor connectivity ❏ Backed by & accessible from Google Cloud Storage Firebase Storage
  • 23. Firebase Storage keylines ● Firebase Storage performs uploads and downloads regardless of network quality. ● Integrates seamlessly with Firebase Authentication to identify users. ● Provides a declarative security language. ● Files stored in Google Cloud Platform - No Firebase Realtime Database.
  • 24. Firebase Storage - Storage security rules ● determine who has read and write access to files stored ● determinate how files are structured and what metadata they contain ● Rules: the allow rule, which allows read and write operations
  • 25. // Grants a user access to a node matching their user ID service firebase.storage { match /b/<your-firebase-storage-bucket>/ { // Files look like: "user/<UID>/path/to/file.txt" match /user/{userId}/{allPaths=**} { allow read, write: if request.auth.uid == userId; } } }
  • 27. // Create a storage reference from our app StorageReference storageRef = storage.getReference(); // Create a reference to "mountains.jpg" StorageReference mountainsRef = storageRef.child("mountains.jpg"); // Create a reference to 'images/mountains.jpg' StorageReference mountainImagesRef = storageRef.child("images/mountains.jpg"); // While the file names are the same, the references point to different files mountainsRef.getName().equals(mountainImagesRef.getName()); // true mountainsRef.getPath().equals(mountainImagesRef.getPath()); // false
  • 28. islandRef = storageRef.child("images/island.jpg"); File localFile = File.createTempFile("images", "jpg"); islandRef.getFile(localFile).....
  • 30. ❏ Cloud-hosted NoSQL database ❏ Synch & conflict resolution ❏ Access directly from the app ❏ Freemium service Firebase Realtime Database
  • 31. Realtime Firebase Realtime Database Keylines Offline No networking code
  • 32. Firebase Realtime Database Structured Data
  • 33. “Kale” “Kale” Realtime Event Realtime Event listRef.push(“Kale”);
  • 34. Firebase Realtime Database Security Rules ● Define: ○ how your data should be structured ○ when data can be read from or written to ● Rules type: ○ .read: Describes if and when data is allowed to be read by users ○ .write: Describes if and when data is allowed to be written. ○ .indexOn: Specifies a child to index to support ordering and querying. ○ .validate: Defines what a correctly formatted value will look like
  • 35. Firebase Realtime Database Security Rules ● Security overview: ○ Authentication: control access to database ○ Authorization: control access to data ○ Data validation: check data consistency ○ Indexes: define indexes for ordering and querying the data
  • 37. DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference(); mDatabase.child("users").child(userId).child("username").setValue(name);
  • 40. ❏ Cloud-hosted NoSQL database ❏ Synch & conflict resolution ❏ Access directly from the app ❏ Freemium service Firebase Firestore
  • 42. Firebase Firestore Data Model ● rooms ○ roomA ■ name : "my chat room" ■ messages 1. message1 a. from : "alex" b. msg : "Hello World!" 2. message2 ■ ... ○ roomB ● ...
  • 44. CollectionReference restaurants = mFirestore.collection("node - name"); restaurants.add(restaurant);
  • 46. mFirestore = FirebaseFirestore.getInstance(); mQuery = mFirestore.collection("restaurants") .orderBy("avgRating", Query.Direction.DESCENDING) .limit(LIMIT);
  • 50. // Listen for any change on document `matteo` in collection `users` exports.myFunctionName = functions.firestore .document('users/matteo).onWrite((event) => { // Function code here });