You might have noticed that there are quite so many courses, tutorials and articles online teaching Firebase. However the problem with these is that most of the time they are incomplete and don't teach you how to use Firebase using modern design patterns. Most of these courses and documentation only teach you simple techniques making it difficult to integrate their code into your own projects. We've taken alot of time calibrating our code so that it is easily extensible and pluggable into all types of projects. Luckily for us, Google had introduced Android Jetpack a few years ago, thus we are able to utilize Clean Architecture in our projects.
You might have noticed that there are quite so many courses, tutorials and articles online teaching Firebase. However the problem with these is that most of the time they are incomplete and don't teach you how to use Firebase using modern design patterns. Most of these courses and documentation only teach you simple techniques making it difficult to integrate their code into your own projects. We've taken alot of time calibrating our code so that it is easily extensible and pluggable into all types of projects. Luckily for us, Google had introduced Android Jetpack a few years ago, thus we are able to utilize Clean Architecture in our projects.
Our projects try as much as possible to be generic and easily customizable. Using MVVM allows us to achieve this. We will be releasing new projects into this course every month, so buying it early allows you to save money and keep getting new projects that respect the latest techniques.
Why CRUD Apps?
Well all types of applications' main role is to manipulate data. And that data manipulation is what is called CRUD(Creating Reading Updating Deleting). If you master these three then you can create any type of application imaginable. These make up the core of any app. And doing it using Clean Architecture ensures you will have a solid code base you can use to easily start any type of app and have something working within a few minutes. That's why we have dedicated this course to creating CRUD apps with search and pagination and storing data offline as well. You can take advantage of that of using what we provide you here as a template to start any type of project.
What is this Course about?
Well in short: Firebase Realtime Database and how to Create several full CRUD applications and apply several caching techniques.
In Long:
We will be creating full applications making use:
Firebase Realtime Database as our data store.
You will learn how to insert select update delete search and paginate/page firebase realtime database data.
You will learn how implement an efficient offline fast approach in development. This means the app will have offline capability even if users completely have no internet connectivity. Through this approach users are still be able to browse data, search data. However to modify we need internet connectivity since our main data store is Firebase Realtime database not SQLite.
You will learn how to apply several aggresive caching techniques like custom permannet Hard Disk caching, caching in SQLite using Room and memory caching.
How to use MVVM - Model View ViewModel to write easy to understand and testable app. You will be surprised how easy our code is to enhance or maintain.
Use several Android Jetpack components like LiveData, ViewModel, Room etc.
Brief History of Firebase
Since the rise of the world wide web in the 1990s, there was only one main way of storing data in the cloud, that was through HTTP web services. You had to write server side code and host in a webserver, then write your web app and talk through HTTP methods. This was still the main way of doing things even with the rise of mobile development in the 2000s. However cloud technologies quickly started to arise like parse and Firebase. Firebase is a mobile and web application development platform developed by Firebase, Inc. in 2011, then acquired by Google in 2014. It is now the main cloud storage technology for mobile development. Firebase Realtime Database is one of the suite of products included in Firebase. It has the following advantages:
It's realtime and allows our data to be synced across a multitude of devices.
It's easy to use and integrate into our projects.
It's cross platform.
It is well maintained by Google engineers. There is also reasonable stability despite the updates.
It has an honest free package.
This is the demo of one of the apps we are creating. Download the app and test it on your device.
This is a quick demo of the application we are creating in the first section. You can use it as a template to create your app. This is easy as the code we are writing is high quality and takes advantage of Clean Architecture. Also be sure to download the APK to see what we are creating.
Am grateful for you buying my course. I have created bonus projects designed to teach you some concepts not covered in this course but which are essential. This app teaches you:
Full Android app development using Kotlin
Clean Architecture
Room
LiveData
Fully offline app(local app)
Am trying to say thank for purchasing my course by creating this project for you. This project is meant to teach you:
Room Data Access Layer - Full CRUD
Model View ViewModel
LiveData
How to import data from csv to room
CarouselView
Page creation and designs
It is basically a template. Be creative and turn it into your own idea app.
Here I provide you with the demo of what we are creating. And by the way you can download the app below. Note that you can request more features to be every app. We will be releasing updates for every app.
In this lesson we are creating our android studio project. We are going to use androidx artifacts and create our project from the 'Empty Activity' template provided by Android Studio.
In this lesson we examine our gradle scripts. We are interested in two files specifically:
build.gradle - Project Level
build.gradle - App Level
We examine their roles with regards to our project.
In this lesson we just want to add custom fonts to our assets folder. We show where to create an assets folder then how to add any font right there. You can search for any font you like online and download then add it. Later on we will see how to load it programmatically using Calligraphy.
MAIN ROLES
Addition of Custom Fonts to our Assets folder.
In this class we:
Add/Define XML animations in an anim folder under our resources.
These animations will either be applied to our widgets in the splas screen or in our activities when transitioning from one activity to the other.
In this section we look at:
Drawables - Images we use throughout project.
Menus - Toolbar menus we will be inflating in our activities.
Colors - Basically colors we will be using throughout our project.
Strings - Strings we use in our project like app_name.
Styles - Themes for our activities.
We look at each of them in this section.
This is our Second model class.
MAIN ROLES
Represent a network request/firebase operation. That operation will have properties like state,message and an optional list of downloaded data.
This is our Application class. android.app.Application, take note, is one of android's main components.
MAIN ROLES:
Initialize our LRU Hard Disk Cache library.
Initialize Calligraphy our font loading library.
This is our Application Constants Class.
MAIN ROLES:
Define and hold for us all our application constants.
We will also hold Firebase Database reference here.
In this lesson we look at our CacheManager class. NB/= Normally Firebase provides default caching mechanism where data is cached for the application lifetime but needs to be reloaded everytime the app is restarted. We want to override this functionality with our caching mechanism where data is cached permanently on the device. Even if the app is restarted we will still have our data without connecting to Firebase. In other words we are creating an OFFLINE - FIRST APP.
MAIN ROLES
Cache our Firebase data in the hard disk permanently asynchronously
Retrieve data From our Cache asynchronously.
In this class we look at our Utils class. That is our Utility class
WHY THIS CLASS?
Normally when creating an application you always need some functionalities in more than one class. Wouldn't it be great if we could define these in a separate class, possibly as static properties then re-use them? Well it's what we do here.
MAIN FUNCTIONALITIES
Define method to show us Toast message.
Validate edittexts.
Open an activity.
Show material info-dialog.
Select a date and render it into an edittext.
Convert a string into a java.util.Date object.
Send and receive a serialized object across activities.
This is our repository class. Remember we are using the Model View ViewModel design pattern. This class will be categorized under our model though it isn't strictly a model or data object class. It is here where we will be writing our CRUD operations logic. That is the code that allows us to post/insert, edit/update, read/select as well as delete data to and from Firebase Realtime Database. This will be a fairly long class.
Our methods will be returning MutableLiveData objects. These LiveData objects will be observed by subscribers thus notifying those subscribers of updates in the data.
YOU CAN RE-USE THE METHODS HERE in any app if you just want a pluggable class to perform CRUD operations including search and filter.
MAIN ROLES
Post Data to Firebase realtime database.
Update existing data in Firebase.
Read and return data in Firebase realtime database.
Delete data from firebase.
Search existing data in Firebase.
This is our FragmentsAdapter class. This class will allow us easily create swipeable tabs whenever we want.
MAIN ROLES
Maintain for us an array to hold fragments through which users will be able to swipe with the help of the ViewPager class.
Return the Fragment title as a CharSequence.
Receive a param of Fragments for which tabs will be created.
Connect our tabs with our fragments as well as viewpager.
This is our base activity class. We want to take advantage of inheritance, one of Object oriented programming pillars so we create a class that will contain functionalities/methods that are common or usable to different activities. Then those methods can simply be inherited by child activities.
MAIN DEFINITIONS
Method for Showing a toast message.
Method for creating a single-choice material dialog that can be used to select an item from an array then render the returned item in an edittext.
method for creating and showing a progress card. That can show us the progress of a firebase operation, its completion as well as failure. It will be capable of showing a title, message and progress dialog.
This method has the same functionality for the BaseActivity had only that it is used for Fragments as opposed to activities. It basically defines functionalities that are common across several fragments.
This is our splash activity, an optional part of any application. You can use a splash screen to portray your brand.
WHAT THIS ACTIVITY DOES
Show logo, title and subtitle when application starts.
Load animations and apply them to those widgets.
Delay/Suspend a thread for a fraction of a second before opening dashboard activity.
APIS/CLASSES USED
TextViews - To show title and subtitle.
ImageView - To show company logo.
AnimationUtils class - To load our animations from an XML resource.
Animation class - To hold the loaded animation so that it can be applied to our widgets.
Thread - To be delayed for a fraction of a second.
WHAT YOU WILL LEARN FROM THIS LESSON
How to load animations from an XML resource into an Animation object, then apply that animation to any android view.
How to delay a thread before opening a new activity.
We start in this class by creating an android studio project. We will use Empty Activity as our template and our source language will be Java.
In this class we will add transition animations in our anim folder under the resources. These animations will be applied in our activities as we transition from one activity to another.
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.