SlideShare a Scribd company logo
1 of 42
Advance Mobile Application
Development
Firebase
Dr. Mazin Alkathiri
IT Department
Seiyun University
2023-2024
Firebase
Firebase is a product of Google which helps developers to build,
manage, and grow their apps easily. It helps developers to build their apps
faster and in a more secure way. No programming is required on the
firebase side which makes it easy to use its features more efficiently. It
provides services to android, ios, web, and unity. It provides cloud
storage. It uses NoSQL for the database for the storage of data.
is a powerful platform for your mobile and web application. Firebase can
power your app’s backend, including data storage, user authentication,
static hosting, and more. With Firebase, you can easily build mobile and
web apps that scale from one user to one million.
Brief History of Firebase:
• Firebase initially was an online chat service provider to various websites
through API and ran with the name Envolve.
• It got popular as developers used it to exchange application data like a
game state in real time across their users more than the chats.
• This resulted in the separation of the Envolve architecture and it’s chat system.
• The Envolve architecture was further evolved by it’s founders James
Tamplin and Andrew Lee,to what modern day Firebase is in the year 2012.
• In April 2012, Firebase was created as a separate company that provided
Backend-as-a-Service with real-time functionality.
• After it was acquired by Google in 2014, Firebase rapidly evolved into the
multifunctional behemoth of a mobile and web platform that it is today.
Firebase Services
Build better apps
Firebase lets you build more powerful, secure and scalable apps, using world-class
infrastructure using:
1. Cloud Firestore: is a flexible, scalable database for mobile, web, and server
development from Firebase and Google Cloud Platform. It is a NoSQL document
database that lets you easily store, sync, and query data for your mobile and web apps
— at a global scale.It’s supporting for Android, iOS and Web Platform.
2. ML Kit: is a mobile SDK that brings Google’s machine learning expertise to Android and
iOS apps in a powerful yet easy-to-use package. Whether you’re new or experienced in
machine learning, you can implement the functionality you need in just a few lines of
code. There’s no need to have deep knowledge of neural networks or model
optimization to get started. On the other hand, if you are an experienced ML developer,
ML Kit provides convenient APIs that help you use your custom TensorFlow Lite models
in your mobile apps. It’s supporting for Android and iOS Platform.
3. Cloud Functions: for Firebase lets you automatically run backend code in response to
events triggered by Firebase features and HTTPS requests. Your code is stored in
Google’s cloud and runs in a managed environment. There’s no need to manage and
scale your own servers. It’s supporting for Android, iOS, C++, Unity and Web Platform.
Build better apps Cont.
4. Authentication: provides backend services, easy-to-use SDKs, and ready-made UI libraries to
authenticate users to your app. It supports authentication using passwords, phone numbers,
popular federated identity providers like Google, Facebook and Twitter, and more. It’s
supporting for Android, iOS and Web Platform.
5. Hosting: is production-grade web content hosting for developers. With a single command, you
can quickly deploy web apps and serve both static and dynamic content to a global CDN
(content delivery network). You can also pair Firebase Hosting with Cloud Functions to build
and host microservices on Firebase. It’s supporting only Web Platform.
6. Cloud Storages: is for object storage service built for Google scale. The Firebase SDKs for Cloud
Storage add Google security to file uploads and downloads for your Firebase apps, regardless
of network quality. You can use our SDKs to store images, audio, video, or other user-
generated content. On the server, you can use Google Cloud Storage, to access the same files.
It’s supporting for Android, iOS, C++, Unity and Web Platform.
7. Real-time Database: is a cloud-hosted NoSQL database that lets you store and sync between
your users in real-time. The Real-time Database is really just one big JSON object that the
developers can manage in real-time. It’s supporting for Android, iOS, C++, Unity and Web
Platform.
Improve app quality
• Firebase gives you insights into app performance and stability, so you can channel your
resources effectively using:
1. Crashlytics: is a lightweight, real-time crash reporter that helps you track, prioritize, and
fix stability issues that erode your app quality. Crashlytics saves you troubleshooting
time by intelligently grouping crashes and highlighting the circumstances that lead up
to them. It’s supporting for Android and iOS Platform.
2. Performance Monitoring: is a service that helps you to gain insight into the
performance characteristics of your iOS and Android apps. You use the Performance
Monitoring SDK to collect performance data from your app, and then review and
analyze that data in the Firebase console. Performance Monitoring helps you to
understand where and when the performance of your app can be improved so that you
can use that information to fix performance issues. It’s supporting for Android and iOS
Platform.
3. Test Labs: is a cloud-based app-testing infrastructure. It provides a large number of
mobile test devices to help you test your apps. It’s supporting for Android and iOS
Platform.
Grow your business
• Firebase helps you grow to millions of users, simplifying user engagement and retention using:
1. In-App Messaging: helps you engage users who are actively using your app by sending them
targeted and contextual messages that nudge them to complete key in-app actions — like
beating a game level, buying an item, or subscribing to content. It’s supporting for Android and
iOS Platform.
2. Google Analytics: for Firebase is a free app measurement solution that provides insight on app
usage and user engagement. At the heart of Firebase is Google Analytics for Firebase, a free
and unlimited analytics solution. Analytics integrates across Firebase features and provides you
with unlimited reporting for up to 500 distinct events that you can define using the Firebase
SDK. Analytics reports help you understand clearly how your users behave, which enables you
to make informed decisions regarding app marketing and performance optimizations. It’s
supporting for Android, iOS, C++ and Unity Platform.
3. Predictions: applies machine learning to your analytics data to create dynamic user segments
based on the predicted behavior of users in your app. These predictions are automatically
available for use with Firebase Remote Config, the Notifications composer, Firebase In-App
Messaging, and A/B Testing. You can also link your app’s Predictions data to BigQuery so you
can get daily exports that you can further analyze or push to third party tools. It’s supporting
for Android, iOS, C++ and Unity Platform.
Grow your business Cont.
4. A/B Testing: helps you optimize your app experience by making it easy to run, analyze, and scale product and
marketing experiments. It gives you the power to test changes to your app’s UI, features, or engagement campaigns
to see if they actually move the needle on your key metrics (like revenue and retention) before you roll them out
widely. It’s supporting for Android, iOS, C++ and Unity Platform.
5. Cloud Messaging(FCM): provides a reliable and battery-efficient connection between your server and devices that
allows you to deliver and receive messages and notifications on iOS, Android, and the web at no cost.
6. Remote Config: essentially allows us to publish updates to our users immediately. Whether we wish to change the
color scheme for a screen, the layout for a particular section in our app or show promotional/seasonal options —
this is completely doable using the server side parameters without the need to publish a new version. It’s
supporting for Android, iOS, C++ and Unity Platform.
7. Dynamic Links: With Dynamic Links, your users get the best available experience for the platform they open your
link on. If a user opens a Dynamic Link on iOS or Android, they can be taken directly to the linked content in your
native app. If a user opens the same Dynamic Link in a desktop browser, they can be taken to the equivalent content
on your website. It’s supporting for Android, iOS, Web, C++ and Unity Platform.
8. App Indexing: gets your app into Google Search. If users have your app installed, they can launch your app and go
directly to the content they’re searching for. App Indexing reengages your app users by helping them find both
public and personal content right on their device, even offering query autocompletion to help them more quickly
find what they need. If users don’t yet have your app, relevant queries trigger an install card for your app in Search
results. It’s supporting for Android and iOS Platform.
Realtime Database
• is a cloud-based NoSQL database that manages your data at the
blazing speed of milliseconds. In simplest term, it can be considered
as a big JSON file.
• Store and sync data with our NoSQL cloud database. Data is synced across
all clients in realtime, and remains available when your app goes offline.
• The Firebase Realtime Database is a cloud-hosted database. Data is stored
as JSON and synchronized in realtime to every connected client. When you
build cross-platform apps with our Apple platforms, Android, and
JavaScript SDKs, all of your clients share one Realtime Database instance
and automatically receive updates with the newest data.
Cloud Firestore:
• Cloud Firestore is a flexible, scalable database for mobile, web, and
server development from Firebase and Google Cloud.
• Like Firebase Realtime Database, it keeps your data in sync across
client apps through realtime listeners and offers offline support for
mobile and web so you can build responsive apps that work
regardless of network latency or Internet connectivity.
• Cloud Firestore also offers seamless integration with other Firebase
and Google Cloud products, including Cloud Functions.
Creating a Firebase project
First step create an account at https://firebase.google.com/
• Then go to Console and Add project
Enter a Name for your Firebase project and continue
• Enable Google Analytics for your Firebase project and continue
• Select your
Default account
for firebase.
• And create the
project.
• Continue.
Connecting flutter to Firebase project
•Get your flutter project
Android Package Name.
•Your package name is
generally the applicationId
in your app-level
build.gradle file
•android/app/build.gradle
android {
namespace
"com.maz.myflutterapp01"
compileSdkVersion
flutter.compileSdkVersion
ndkVersion
flutter.ndkVersion
• Move your
downloaded google-
services.json file
• into your module
(app-level) root
directory.
• android/app/
• Skip the next Step and continue
to the console
• Step 2: Add the following in the AndroidManifest.xml file, in the
manifest -> application section
• android/app/src/main/AndroidManifest.xml
<meta-data
android:name="firebase_messaging_auto_init_enabled"
android:value="false" />
<meta-data
android:name="firebase_analytics_collection_enabled"
android:value="false" />
</application>
</manifest>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
• Step 3: Don’t add plugin { … }
• As per the Firebase docs, you need to add plugin { … } in gradle.build but you
shouldn’t add that.
• Instead, add classpath “com.google.gms:google-services:4.3.13” in
android/build.gradle file as shown in the image below.
• Upgrade the Kotlin to the appropriate version if you get any related error
buildscript {
ext.kotlin_version = '1.9.0'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.google.gms:google-services:4.3.13"
}
}
• Step 4: Update android/app/build.gradle file
• Add apply plugin: ‘com.google.gms.google-services’ as shown in the
image below
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id "com.google.gms.google-services"
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.maz.myflutterapp01"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id
applicationId "com.maz.myflutterapp01"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-config
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
• Add multiDexEnabled true in android -> defaultConfig section
• Add implementation platform(‘com.google.firebase:firebase-bom:32.7.0’) in
dependencies, this will take care of version compatibility of all the Firebase
packages
• Add implementation ‘com.google.firebase:firebase-analytics’
• Then add the package that your app needs, for instance, if it requires Firebase
Messaging (FCM), add implementation ‘com.google.firebase:firebase-
messaging’
flutter {
source '../..'
}
dependencies {}
flutter {
source '../..'
}
dependencies {
implementation platform('com.google.firebase:firebase-bom:32.7.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-messaging'
}
Now run your APP To make sure that there are no
mistakes and it’s connected it’s connected
Creating FireStore Databse
• From your Firebase project Console
select Bulid > Firestore Databse
• Then click on create databse
Creating collections and inserting data
firebase_core:
firebase_auth:
cloud_firestore:
random_string:
fluttertoast:
permission_handler:
• Start by creating a new dbfirebase.dart
• Then will create a class called dbfirebase.dart for handling all the
database queries
import 'package:cloud_firestore/cloud_firestore.dart';
class Databasemethods{
}
• Then will create our first function addData() for creating and inserting
clollection
import 'package:cloud_firestore/cloud_firestore.dart';
class Databasemethods{
Future addData(Map<String, dynamic> DoctorsInfoMap, String id)async{
return await FirebaseFirestore.instance
.collection("lecturer")
.doc(id)
.set(LecInfoMap);
}
}
• Create a form with the following texfields
var _formKey = GlobalKey<FormState>();
TextEditingController lecName=new TextEditingController();
TextEditingController lecPhNo=new TextEditingController();
TextEditingController lecCol=new TextEditingController();
TextEditingController lecDept=new TextEditingController();
Databasemethods dbobj=new Databasemethods();
ElevatedButton(
child: Text(
"‫"تسجيل‬,
style: TextStyle(
fontSize: 16.0,
),
),
onPressed: () async{
String id =randomAlphaNumeric(10);
// _submit();
Map<String, dynamic> lecInfoMap={
"ID":id,
"doctName":doctName.text,
"doctPhoneNo":doctPhNo.text,
"doctSpc":doctSpc.text,
"clinic":clinicName.text,
};
>>>>><<<<<<<
}
),
await Databasemethods().addData(lecInfoMap, id).then((value) {
Fluttertoast.showToast(
msg: "Doctore infor have been added successfully ",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
fontSize: 16.0
);
});
• Also before running e should initialize the flutter project
void main() async{
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(const MyApp());
}
• And before you run make sure your app has the permission to access
the internet.
• By editing android/app/src/main/AndroidManifest.xml
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET" ></uses-permission>
<application
• Before running we should run the following commands
• Flutter clean
• Fluter run
• Then add minSdkVersion 21 the build.gradle in the app level as the
following
Advance Mobile Application Development class 04

More Related Content

What's hot

Park in : Business plan
Park in : Business planPark in : Business plan
Park in : Business plansurbhi mathur
 
INDIGO V/S SPICEJET
INDIGO V/S SPICEJETINDIGO V/S SPICEJET
INDIGO V/S SPICEJETROHITRAJ433
 
ChowNow Sales Demo Presentation
ChowNow Sales Demo PresentationChowNow Sales Demo Presentation
ChowNow Sales Demo PresentationWyatt Fout
 
New product development
New product developmentNew product development
New product developmentUdit Jain
 
Smart Parking Solutions for Cities & Universities: 2016
Smart Parking Solutions for Cities & Universities: 2016Smart Parking Solutions for Cities & Universities: 2016
Smart Parking Solutions for Cities & Universities: 2016Mark Braibanti
 
Tactical Brand Marketing Plan - UBER Munich, Germany
Tactical Brand Marketing Plan - UBER Munich, GermanyTactical Brand Marketing Plan - UBER Munich, Germany
Tactical Brand Marketing Plan - UBER Munich, GermanyEvelyn Sindermann
 
Business Model Canvas of Ola Cabs by Akshay Nahar
Business Model Canvas of Ola Cabs by Akshay NaharBusiness Model Canvas of Ola Cabs by Akshay Nahar
Business Model Canvas of Ola Cabs by Akshay NaharAkshay nahar
 

What's hot (10)

Park in : Business plan
Park in : Business planPark in : Business plan
Park in : Business plan
 
E-Auction
E-AuctionE-Auction
E-Auction
 
INDIGO V/S SPICEJET
INDIGO V/S SPICEJETINDIGO V/S SPICEJET
INDIGO V/S SPICEJET
 
ChowNow Sales Demo Presentation
ChowNow Sales Demo PresentationChowNow Sales Demo Presentation
ChowNow Sales Demo Presentation
 
New product development
New product developmentNew product development
New product development
 
Uber case study
Uber case studyUber case study
Uber case study
 
BMW Presentation
BMW PresentationBMW Presentation
BMW Presentation
 
Smart Parking Solutions for Cities & Universities: 2016
Smart Parking Solutions for Cities & Universities: 2016Smart Parking Solutions for Cities & Universities: 2016
Smart Parking Solutions for Cities & Universities: 2016
 
Tactical Brand Marketing Plan - UBER Munich, Germany
Tactical Brand Marketing Plan - UBER Munich, GermanyTactical Brand Marketing Plan - UBER Munich, Germany
Tactical Brand Marketing Plan - UBER Munich, Germany
 
Business Model Canvas of Ola Cabs by Akshay Nahar
Business Model Canvas of Ola Cabs by Akshay NaharBusiness Model Canvas of Ola Cabs by Akshay Nahar
Business Model Canvas of Ola Cabs by Akshay Nahar
 

Similar to Advance Mobile Application Development class 04

Firebase integration with Flutter
Firebase integration with FlutterFirebase integration with Flutter
Firebase integration with Flutterpmgdscunsri
 
Google Firebase
Google FirebaseGoogle Firebase
Google FirebaseAliZaidi94
 
Firebase in a Nutshell
Firebase in a NutshellFirebase in a Nutshell
Firebase in a NutshellSumit Sahoo
 
Google Firebase Presentation
Google Firebase PresentationGoogle Firebase Presentation
Google Firebase PresentationAeni Patel
 
Mobile Programming - 10 Firebase
Mobile Programming - 10 FirebaseMobile Programming - 10 Firebase
Mobile Programming - 10 FirebaseAndiNurkholis1
 
Top 5 Benefits Of Firebase Database System.pptx
Top 5 Benefits Of Firebase Database System.pptxTop 5 Benefits Of Firebase Database System.pptx
Top 5 Benefits Of Firebase Database System.pptxFlutter Agency
 
Tk2323 lecture 8 firebase
Tk2323 lecture 8   firebaseTk2323 lecture 8   firebase
Tk2323 lecture 8 firebaseMengChun Lam
 
Deploy Firebase Backend as a Service Model for Application Development
Deploy Firebase Backend as a Service Model for Application DevelopmentDeploy Firebase Backend as a Service Model for Application Development
Deploy Firebase Backend as a Service Model for Application DevelopmentDashTechnologiesInc
 
AWS Amplify vs. Firebase Selecting the Best Backend for Your Apps.pdf
AWS Amplify vs. Firebase Selecting the Best Backend for Your Apps.pdfAWS Amplify vs. Firebase Selecting the Best Backend for Your Apps.pdf
AWS Amplify vs. Firebase Selecting the Best Backend for Your Apps.pdfLaura Miller
 
intrduction to firebase.pptx
intrduction to firebase.pptxintrduction to firebase.pptx
intrduction to firebase.pptx21IT324MariAppan
 
Alumni-Student Interactive Messaging
Alumni-Student Interactive MessagingAlumni-Student Interactive Messaging
Alumni-Student Interactive MessagingIRJET Journal
 
Top 9 Frameworks that would disrupt the mobile app development in 2022
Top 9 Frameworks that would disrupt the mobile app development in 2022Top 9 Frameworks that would disrupt the mobile app development in 2022
Top 9 Frameworks that would disrupt the mobile app development in 2022Inexture Solutions
 

Similar to Advance Mobile Application Development class 04 (20)

Firebase integration with Flutter
Firebase integration with FlutterFirebase integration with Flutter
Firebase integration with Flutter
 
Google Firebase
Google FirebaseGoogle Firebase
Google Firebase
 
Firebase in a Nutshell
Firebase in a NutshellFirebase in a Nutshell
Firebase in a Nutshell
 
Google Firebase Presentation
Google Firebase PresentationGoogle Firebase Presentation
Google Firebase Presentation
 
Mobile Programming - 10 Firebase
Mobile Programming - 10 FirebaseMobile Programming - 10 Firebase
Mobile Programming - 10 Firebase
 
Firebase
FirebaseFirebase
Firebase
 
Top 5 Benefits Of Firebase Database System.pptx
Top 5 Benefits Of Firebase Database System.pptxTop 5 Benefits Of Firebase Database System.pptx
Top 5 Benefits Of Firebase Database System.pptx
 
Tk2323 lecture 8 firebase
Tk2323 lecture 8   firebaseTk2323 lecture 8   firebase
Tk2323 lecture 8 firebase
 
19-03-22.pdf
19-03-22.pdf19-03-22.pdf
19-03-22.pdf
 
Deploy Firebase Backend as a Service Model for Application Development
Deploy Firebase Backend as a Service Model for Application DevelopmentDeploy Firebase Backend as a Service Model for Application Development
Deploy Firebase Backend as a Service Model for Application Development
 
Firebase Tech Talk By Atlogys
Firebase Tech Talk By AtlogysFirebase Tech Talk By Atlogys
Firebase Tech Talk By Atlogys
 
AWS Amplify vs. Firebase Selecting the Best Backend for Your Apps.pdf
AWS Amplify vs. Firebase Selecting the Best Backend for Your Apps.pdfAWS Amplify vs. Firebase Selecting the Best Backend for Your Apps.pdf
AWS Amplify vs. Firebase Selecting the Best Backend for Your Apps.pdf
 
intrduction to firebase.pptx
intrduction to firebase.pptxintrduction to firebase.pptx
intrduction to firebase.pptx
 
Firebase Services
Firebase ServicesFirebase Services
Firebase Services
 
Google MLkit
Google MLkitGoogle MLkit
Google MLkit
 
Alumni-Student Interactive Messaging
Alumni-Student Interactive MessagingAlumni-Student Interactive Messaging
Alumni-Student Interactive Messaging
 
Mobile Development
Mobile DevelopmentMobile Development
Mobile Development
 
Firebase Android
Firebase AndroidFirebase Android
Firebase Android
 
Top 9 Frameworks that would disrupt the mobile app development in 2022
Top 9 Frameworks that would disrupt the mobile app development in 2022Top 9 Frameworks that would disrupt the mobile app development in 2022
Top 9 Frameworks that would disrupt the mobile app development in 2022
 
madanResume
madanResumemadanResume
madanResume
 

More from Dr. Mazin Mohamed alkathiri

ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)
ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)
ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)Dr. Mazin Mohamed alkathiri
 
Advance Mobile Application Development class 02-B
Advance Mobile Application Development class 02-BAdvance Mobile Application Development class 02-B
Advance Mobile Application Development class 02-BDr. Mazin Mohamed alkathiri
 
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)Dr. Mazin Mohamed alkathiri
 
Academic Writing (Technical report writing ) class 07
Academic Writing (Technical report writing ) class 07Academic Writing (Technical report writing ) class 07
Academic Writing (Technical report writing ) class 07Dr. Mazin Mohamed alkathiri
 

More from Dr. Mazin Mohamed alkathiri (20)

ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Advance Mobile Application Development class 05
Advance Mobile Application Development class 05Advance Mobile Application Development class 05
Advance Mobile Application Development class 05
 
ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)
ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)
ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)
 
OS-operating systems- ch03
OS-operating systems- ch03OS-operating systems- ch03
OS-operating systems- ch03
 
OS-operating systems - ch02 - part-2-2024
OS-operating systems - ch02 - part-2-2024OS-operating systems - ch02 - part-2-2024
OS-operating systems - ch02 - part-2-2024
 
Advance Mobile Application Development class 03
Advance Mobile Application Development class 03Advance Mobile Application Development class 03
Advance Mobile Application Development class 03
 
Advance Mobile Application Development class 02-B
Advance Mobile Application Development class 02-BAdvance Mobile Application Development class 02-B
Advance Mobile Application Development class 02-B
 
OS-ch02-part-1-2024.ppt
OS-ch02-part-1-2024.pptOS-ch02-part-1-2024.ppt
OS-ch02-part-1-2024.ppt
 
Advance Mobile Application Development class 02
Advance Mobile Application Development class 02Advance Mobile Application Development class 02
Advance Mobile Application Development class 02
 
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
 
Advance Mobile Application Development class 01
Advance Mobile Application Development class 01Advance Mobile Application Development class 01
Advance Mobile Application Development class 01
 
ESSENTIAL of (CS/IT/IS) class 02 (HCI)
ESSENTIAL of (CS/IT/IS) class 02 (HCI)ESSENTIAL of (CS/IT/IS) class 02 (HCI)
ESSENTIAL of (CS/IT/IS) class 02 (HCI)
 
Seminar
SeminarSeminar
Seminar
 
ESSENTIAL of (CS/IT/IS)
ESSENTIAL of (CS/IT/IS)ESSENTIAL of (CS/IT/IS)
ESSENTIAL of (CS/IT/IS)
 
OS-ch01-2024.ppt
OS-ch01-2024.pptOS-ch01-2024.ppt
OS-ch01-2024.ppt
 
Mobile Application Development class 008
Mobile Application Development class 008Mobile Application Development class 008
Mobile Application Development class 008
 
Academic Writing (Punctuation ) class 06
Academic Writing (Punctuation ) class 06Academic Writing (Punctuation ) class 06
Academic Writing (Punctuation ) class 06
 
Academic Writing (Technical report writing ) class 07
Academic Writing (Technical report writing ) class 07Academic Writing (Technical report writing ) class 07
Academic Writing (Technical report writing ) class 07
 
Computer Introduction-Lecture07
Computer Introduction-Lecture07Computer Introduction-Lecture07
Computer Introduction-Lecture07
 

Recently uploaded

USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 

Recently uploaded (20)

USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 

Advance Mobile Application Development class 04

  • 1. Advance Mobile Application Development Firebase Dr. Mazin Alkathiri IT Department Seiyun University 2023-2024
  • 2. Firebase Firebase is a product of Google which helps developers to build, manage, and grow their apps easily. It helps developers to build their apps faster and in a more secure way. No programming is required on the firebase side which makes it easy to use its features more efficiently. It provides services to android, ios, web, and unity. It provides cloud storage. It uses NoSQL for the database for the storage of data. is a powerful platform for your mobile and web application. Firebase can power your app’s backend, including data storage, user authentication, static hosting, and more. With Firebase, you can easily build mobile and web apps that scale from one user to one million.
  • 3. Brief History of Firebase: • Firebase initially was an online chat service provider to various websites through API and ran with the name Envolve. • It got popular as developers used it to exchange application data like a game state in real time across their users more than the chats. • This resulted in the separation of the Envolve architecture and it’s chat system. • The Envolve architecture was further evolved by it’s founders James Tamplin and Andrew Lee,to what modern day Firebase is in the year 2012. • In April 2012, Firebase was created as a separate company that provided Backend-as-a-Service with real-time functionality. • After it was acquired by Google in 2014, Firebase rapidly evolved into the multifunctional behemoth of a mobile and web platform that it is today.
  • 5. Build better apps Firebase lets you build more powerful, secure and scalable apps, using world-class infrastructure using: 1. Cloud Firestore: is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud Platform. It is a NoSQL document database that lets you easily store, sync, and query data for your mobile and web apps — at a global scale.It’s supporting for Android, iOS and Web Platform. 2. ML Kit: is a mobile SDK that brings Google’s machine learning expertise to Android and iOS apps in a powerful yet easy-to-use package. Whether you’re new or experienced in machine learning, you can implement the functionality you need in just a few lines of code. There’s no need to have deep knowledge of neural networks or model optimization to get started. On the other hand, if you are an experienced ML developer, ML Kit provides convenient APIs that help you use your custom TensorFlow Lite models in your mobile apps. It’s supporting for Android and iOS Platform. 3. Cloud Functions: for Firebase lets you automatically run backend code in response to events triggered by Firebase features and HTTPS requests. Your code is stored in Google’s cloud and runs in a managed environment. There’s no need to manage and scale your own servers. It’s supporting for Android, iOS, C++, Unity and Web Platform.
  • 6. Build better apps Cont. 4. Authentication: provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app. It supports authentication using passwords, phone numbers, popular federated identity providers like Google, Facebook and Twitter, and more. It’s supporting for Android, iOS and Web Platform. 5. Hosting: is production-grade web content hosting for developers. With a single command, you can quickly deploy web apps and serve both static and dynamic content to a global CDN (content delivery network). You can also pair Firebase Hosting with Cloud Functions to build and host microservices on Firebase. It’s supporting only Web Platform. 6. Cloud Storages: is for object storage service built for Google scale. The Firebase SDKs for Cloud Storage add Google security to file uploads and downloads for your Firebase apps, regardless of network quality. You can use our SDKs to store images, audio, video, or other user- generated content. On the server, you can use Google Cloud Storage, to access the same files. It’s supporting for Android, iOS, C++, Unity and Web Platform. 7. Real-time Database: is a cloud-hosted NoSQL database that lets you store and sync between your users in real-time. The Real-time Database is really just one big JSON object that the developers can manage in real-time. It’s supporting for Android, iOS, C++, Unity and Web Platform.
  • 7. Improve app quality • Firebase gives you insights into app performance and stability, so you can channel your resources effectively using: 1. Crashlytics: is a lightweight, real-time crash reporter that helps you track, prioritize, and fix stability issues that erode your app quality. Crashlytics saves you troubleshooting time by intelligently grouping crashes and highlighting the circumstances that lead up to them. It’s supporting for Android and iOS Platform. 2. Performance Monitoring: is a service that helps you to gain insight into the performance characteristics of your iOS and Android apps. You use the Performance Monitoring SDK to collect performance data from your app, and then review and analyze that data in the Firebase console. Performance Monitoring helps you to understand where and when the performance of your app can be improved so that you can use that information to fix performance issues. It’s supporting for Android and iOS Platform. 3. Test Labs: is a cloud-based app-testing infrastructure. It provides a large number of mobile test devices to help you test your apps. It’s supporting for Android and iOS Platform.
  • 8. Grow your business • Firebase helps you grow to millions of users, simplifying user engagement and retention using: 1. In-App Messaging: helps you engage users who are actively using your app by sending them targeted and contextual messages that nudge them to complete key in-app actions — like beating a game level, buying an item, or subscribing to content. It’s supporting for Android and iOS Platform. 2. Google Analytics: for Firebase is a free app measurement solution that provides insight on app usage and user engagement. At the heart of Firebase is Google Analytics for Firebase, a free and unlimited analytics solution. Analytics integrates across Firebase features and provides you with unlimited reporting for up to 500 distinct events that you can define using the Firebase SDK. Analytics reports help you understand clearly how your users behave, which enables you to make informed decisions regarding app marketing and performance optimizations. It’s supporting for Android, iOS, C++ and Unity Platform. 3. Predictions: applies machine learning to your analytics data to create dynamic user segments based on the predicted behavior of users in your app. These predictions are automatically available for use with Firebase Remote Config, the Notifications composer, Firebase In-App Messaging, and A/B Testing. You can also link your app’s Predictions data to BigQuery so you can get daily exports that you can further analyze or push to third party tools. It’s supporting for Android, iOS, C++ and Unity Platform.
  • 9. Grow your business Cont. 4. A/B Testing: helps you optimize your app experience by making it easy to run, analyze, and scale product and marketing experiments. It gives you the power to test changes to your app’s UI, features, or engagement campaigns to see if they actually move the needle on your key metrics (like revenue and retention) before you roll them out widely. It’s supporting for Android, iOS, C++ and Unity Platform. 5. Cloud Messaging(FCM): provides a reliable and battery-efficient connection between your server and devices that allows you to deliver and receive messages and notifications on iOS, Android, and the web at no cost. 6. Remote Config: essentially allows us to publish updates to our users immediately. Whether we wish to change the color scheme for a screen, the layout for a particular section in our app or show promotional/seasonal options — this is completely doable using the server side parameters without the need to publish a new version. It’s supporting for Android, iOS, C++ and Unity Platform. 7. Dynamic Links: With Dynamic Links, your users get the best available experience for the platform they open your link on. If a user opens a Dynamic Link on iOS or Android, they can be taken directly to the linked content in your native app. If a user opens the same Dynamic Link in a desktop browser, they can be taken to the equivalent content on your website. It’s supporting for Android, iOS, Web, C++ and Unity Platform. 8. App Indexing: gets your app into Google Search. If users have your app installed, they can launch your app and go directly to the content they’re searching for. App Indexing reengages your app users by helping them find both public and personal content right on their device, even offering query autocompletion to help them more quickly find what they need. If users don’t yet have your app, relevant queries trigger an install card for your app in Search results. It’s supporting for Android and iOS Platform.
  • 10. Realtime Database • is a cloud-based NoSQL database that manages your data at the blazing speed of milliseconds. In simplest term, it can be considered as a big JSON file. • Store and sync data with our NoSQL cloud database. Data is synced across all clients in realtime, and remains available when your app goes offline. • The Firebase Realtime Database is a cloud-hosted database. Data is stored as JSON and synchronized in realtime to every connected client. When you build cross-platform apps with our Apple platforms, Android, and JavaScript SDKs, all of your clients share one Realtime Database instance and automatically receive updates with the newest data.
  • 11. Cloud Firestore: • Cloud Firestore is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud. • Like Firebase Realtime Database, it keeps your data in sync across client apps through realtime listeners and offers offline support for mobile and web so you can build responsive apps that work regardless of network latency or Internet connectivity. • Cloud Firestore also offers seamless integration with other Firebase and Google Cloud products, including Cloud Functions.
  • 12. Creating a Firebase project First step create an account at https://firebase.google.com/
  • 13. • Then go to Console and Add project
  • 14. Enter a Name for your Firebase project and continue
  • 15. • Enable Google Analytics for your Firebase project and continue
  • 16. • Select your Default account for firebase. • And create the project. • Continue.
  • 17. Connecting flutter to Firebase project
  • 18. •Get your flutter project Android Package Name. •Your package name is generally the applicationId in your app-level build.gradle file •android/app/build.gradle android { namespace "com.maz.myflutterapp01" compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion
  • 19. • Move your downloaded google- services.json file • into your module (app-level) root directory. • android/app/
  • 20. • Skip the next Step and continue to the console
  • 21. • Step 2: Add the following in the AndroidManifest.xml file, in the manifest -> application section • android/app/src/main/AndroidManifest.xml <meta-data android:name="firebase_messaging_auto_init_enabled" android:value="false" /> <meta-data android:name="firebase_analytics_collection_enabled" android:value="false" /> </application> </manifest> <meta-data android:name="flutterEmbedding" android:value="2" /> </application> </manifest>
  • 22. • Step 3: Don’t add plugin { … } • As per the Firebase docs, you need to add plugin { … } in gradle.build but you shouldn’t add that. • Instead, add classpath “com.google.gms:google-services:4.3.13” in android/build.gradle file as shown in the image below. • Upgrade the Kotlin to the appropriate version if you get any related error
  • 23. buildscript { ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "com.google.gms:google-services:4.3.13" } }
  • 24. • Step 4: Update android/app/build.gradle file • Add apply plugin: ‘com.google.gms.google-services’ as shown in the image below plugins { id "com.android.application" id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" } plugins { id "com.android.application" id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" id "com.google.gms.google-services" }
  • 25. defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.maz.myflutterapp01" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id applicationId "com.maz.myflutterapp01" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-config minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true } • Add multiDexEnabled true in android -> defaultConfig section
  • 26. • Add implementation platform(‘com.google.firebase:firebase-bom:32.7.0’) in dependencies, this will take care of version compatibility of all the Firebase packages • Add implementation ‘com.google.firebase:firebase-analytics’ • Then add the package that your app needs, for instance, if it requires Firebase Messaging (FCM), add implementation ‘com.google.firebase:firebase- messaging’ flutter { source '../..' } dependencies {} flutter { source '../..' } dependencies { implementation platform('com.google.firebase:firebase-bom:32.7.0') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-messaging' }
  • 27. Now run your APP To make sure that there are no mistakes and it’s connected it’s connected
  • 28. Creating FireStore Databse • From your Firebase project Console select Bulid > Firestore Databse
  • 29. • Then click on create databse
  • 30.
  • 31.
  • 32.
  • 33.
  • 34. Creating collections and inserting data firebase_core: firebase_auth: cloud_firestore: random_string: fluttertoast: permission_handler:
  • 35. • Start by creating a new dbfirebase.dart • Then will create a class called dbfirebase.dart for handling all the database queries import 'package:cloud_firestore/cloud_firestore.dart'; class Databasemethods{ }
  • 36. • Then will create our first function addData() for creating and inserting clollection import 'package:cloud_firestore/cloud_firestore.dart'; class Databasemethods{ Future addData(Map<String, dynamic> DoctorsInfoMap, String id)async{ return await FirebaseFirestore.instance .collection("lecturer") .doc(id) .set(LecInfoMap); } }
  • 37. • Create a form with the following texfields var _formKey = GlobalKey<FormState>(); TextEditingController lecName=new TextEditingController(); TextEditingController lecPhNo=new TextEditingController(); TextEditingController lecCol=new TextEditingController(); TextEditingController lecDept=new TextEditingController(); Databasemethods dbobj=new Databasemethods();
  • 38. ElevatedButton( child: Text( "‫"تسجيل‬, style: TextStyle( fontSize: 16.0, ), ), onPressed: () async{ String id =randomAlphaNumeric(10); // _submit(); Map<String, dynamic> lecInfoMap={ "ID":id, "doctName":doctName.text, "doctPhoneNo":doctPhNo.text, "doctSpc":doctSpc.text, "clinic":clinicName.text, }; >>>>><<<<<<< } ), await Databasemethods().addData(lecInfoMap, id).then((value) { Fluttertoast.showToast( msg: "Doctore infor have been added successfully ", toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.CENTER, timeInSecForIosWeb: 1, backgroundColor: Colors.red, textColor: Colors.white, fontSize: 16.0 ); });
  • 39. • Also before running e should initialize the flutter project void main() async{ WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); runApp(const MyApp()); }
  • 40. • And before you run make sure your app has the permission to access the internet. • By editing android/app/src/main/AndroidManifest.xml <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.INTERNET" ></uses-permission> <application
  • 41. • Before running we should run the following commands • Flutter clean • Fluter run • Then add minSdkVersion 21 the build.gradle in the app level as the following