Android Firebase MVVM Jetpack - Many Offline-First CRUD Apps
3.6 (4 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
44 students enrolled

Android Firebase MVVM Jetpack - Many Offline-First CRUD Apps

Create full offline first Firebase apps by utilizing Clean Architecture and Android Jetpack.(NEW PROJECTS EVERY MONTH)
3.6 (4 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
44 students enrolled
Created by Clement Ochieng
Last updated 4/2020
English
English [Auto]
Current price: $12.99 Original price: $19.99 Discount: 35% off
14 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 13 hours on-demand video
  • 16 articles
  • 12 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • How to create several full offline first apps ready for play store using Firebase Realtime Database
  • Firebase Cloud Storage - Upload/Download/Update/Delete Images
  • Android Jetpack Components like Room,LiveData and ViewModel usage with Firebase
  • Android MVVM(Model View ViewModel) and Clean Architecture in a real world project backed by Firebase
  • INSERT SELECT UPDATE DELETE SEARCH PAGINATION in Firebase Realtime Database
  • How to upload and download images to and from Firebase Cloud Storage
  • Custom permanent hard disk LRU data caching of Firebase Realtime Database data
  • Firebase + SQLite local database using Room Data Access Layer
Course content
Expand all 113 lectures 13:12:53
+ APPS CREATED SO FAR
7 lectures 00:31

This is the demo of one of the apps we are creating. Download the app and test it on your device.

Preview 00:07

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.

Preview 00:03

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:

  1. Full Android app development using Kotlin

  2. Clean Architecture

  3. Room

  4. LiveData

  5. Fully offline app(local app)

Preview 00:04

Am trying to say thank for purchasing my course by creating this project for you. This project is meant to teach you:

  1. Room Data Access Layer - Full CRUD

  2. Model View ViewModel

  3. LiveData

  4. How to import data from csv to room

  5. CarouselView

  6. Page creation and designs

It is basically a template. Be creative and turn it into your own idea app.

Preview 00:03
+ 1. Fully Offfline MVVM Scientists App - WITH CUSTOM PERMANENT HARD DISK CACHING
30 lectures 05:36:46

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.

Preview 05:03

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.

Preview 01:07

In this lesson we examine our gradle scripts. We are interested in two files specifically:

  1. build.gradle - Project Level

  2. build.gradle - App Level

We examine their roles with regards to our project.

Add Gradle Dependencies
12:00

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

  1. Addition of Custom Fonts to our Assets folder.

Add Custom Fonts in Assets Folder
01:12

In this class we:

  1. Add/Define XML animations in an anim folder under our resources.

  2. 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.

Adding Activity Transition Animations
03:18

In this section we look at:

  1. Drawables - Images we use throughout project.

  2. Menus - Toolbar menus we will be inflating in our activities.

  3. Colors - Basically colors we will be using throughout our project.

  4. Strings - Strings we use in our project like app_name.

  5. Styles - Themes for our activities.

We look at each of them in this section.

Preparing Menus,Drawables as well as Value Resources
12:49
Model Classes (a). Scientist
05:00

This is our Second model class.

MAIN ROLES

  1. Represent a network request/firebase operation. That operation will have properties like state,message and an optional list of downloaded data.

Model Classes (b). RequestCall
02:53

This is our Application class. android.app.Application, take note, is one of android's main components.

MAIN ROLES:

  1. Initialize our LRU Hard Disk Cache library.

  2. Initialize Calligraphy our font loading library.

Global Classes (a). App - Initialize Calligraphy and Disk Caching
05:42

This is our Application Constants Class.

MAIN ROLES:

  1. Define and hold for us all our application constants.

  2. We will also hold Firebase Database reference here.

Global Classes (b). Constants - Our Global Variables
03:41

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

  1. Cache our Firebase data in the hard disk permanently asynchronously

  2. Retrieve data From our Cache asynchronously.

Global Classes (c). CacheManager - How to Cache Data permanently to Hard Disk
15:32

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

  1. Define method to show us Toast message.

  2. Validate edittexts.

  3. Open an activity.

  4. Show material info-dialog.

  5. Select a date and render it into an edittext.

  6. Convert a string into a java.util.Date object.

  7. Send and receive a serialized object across activities.

Preview 16:12

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

  1. Post Data to Firebase realtime database.

  2. Update existing data in Firebase.

  3. Read and return data in Firebase realtime database.

  4. Delete data from  firebase.

  5. Search existing data in Firebase.

Repository Classes (a). ScientistsRepository
29:49
ViewModel Classes (a). Our Scientists ViewModel
06:45
Adapter Classes (a) - SearchableAdapter
19:02

This is our FragmentsAdapter class. This class will allow us easily create swipeable tabs whenever we want.

MAIN ROLES

  1. Maintain for us an array to hold fragments through which users will be able to swipe with the help of the ViewPager class.

  2. Return the Fragment title as a CharSequence.

  3. Receive a param of Fragments for which tabs will be created.

  4. Connect our tabs with our fragments as well as viewpager.

Adapter Classes (b) - FragmentsAdapter - One class to create ViewPager and Tabs
13:53

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

  1. Method for Showing a toast message.

  2. 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.

  3. 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.


Base Classes (a). BaseActivity - Encapsulate inheritable base properties
17:15

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.

Base Classes (b) . BaseFragment
04:57

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

  1. Show logo, title and subtitle when application starts.

  2. Load animations and apply them to those widgets.

  3. Delay/Suspend a thread for a fraction of a second before opening dashboard activity.

APIS/CLASSES USED

  1. TextViews - To show title and subtitle.

  2. ImageView - To show company logo.

  3. AnimationUtils class - To load our animations from an XML resource.

  4. Animation class - To hold the loaded animation so that it can be applied to our widgets.

  5. Thread - To be delayed for a fraction of a second.

WHAT YOU WILL LEARN FROM THIS LESSON

  1. How to load animations from an XML resource into an Animation object, then apply that animation to any android view.

  2. How to delay a thread before opening a new activity.



User Activities (a). Splash Activity - How to Create Beautiful splash screen
12:58
User Activities (b).1. Dashboard Activity - LAYOUT
08:53
User Activities (b).2. Dashboard Activity - CODE
08:53
User Activities (c).1. CRUD Activity - LAYOUT
04:36
User Activities (c).2. CRUD Activity - Firebase CRUD
34:15
User Activities (d). Listings Activity - Class to host fragments
12:47
User Activities (e). 1. Detail Activity - LAYOUT
05:38
User Activities (e).2. Detail Activity - Show scientist details
08:19
Fragments (a). Listings Fragment - Fetching from Firebase and caching locally
28:42
Fragments (a). Search Fragment - Search Firebase Data or Cached Data
21:05
Fragments (c). Latest Fragment - Fetching from Disk Cache
14:29
Download Full Source Code - High quality, easy to understand and modify code
00:01
+ 2. Offline-first Firebase+Room CRUD App Clean Architecture
40 lectures 03:53:34
Add Gradle Dependencies
08:08
Add Custom Fonts in Assets Folder
02:02
Add Transition Animations
02:18
Prepare Drawables and Menu Resources
04:32
Preparing Value Resources - Colors,Styles,Strings
05:30
Global Classes (a). App
02:27
Global Classes (b). Constants
02:22
Global Classes (c). CacheManager
00:58
Global Classes (d). Utils - Several reusable methods
11:07
Global Classes (e). FilterHelper
05:45
Model Classes (a). Scientist
05:15
Model Classes (b). RequestCall
02:07
DAO Interfaces (a). ScientistsDAO
04:10
Room Database - MyRoomDB
03:53
Repository Classes (a). LocalRepository - Performing SQLite CRUD
05:53
Layouts (a). _state - Progress State with messages
03:51
Layouts (b). Model and Model Grid Layouts - RecyclerView ItemViews
02:24
Base Classes (a). BaseActivity
10:06
Base Classes (b) - BaseFragment
07:52
Adapter Classes (a) - FragmentsAdapter
10:25
Activities (a).1 Splash Activity - LAYOUT
00:37
Activities (a).2 Splash Activity - CODE
05:46
Activities (b).1 Dashboard Activity - LAYOUT
03:22
Activities (b).2 Dashboard Activity - CODE
04:28
Activities (b).1 CRUD Activity - LAYOUT
03:18
Activities (b).2 CRUD Activity - CODE
21:52
Activities (d). Listings Activity - CODE
07:55
Activities (e)1. Detail Activity - LAYOUT
04:57
Activities (e).1 Detail Activity - CODE
08:41
Fragments (a).1 Latest Fragment- LAYOUT
01:27
Fragments (a).2 Latest Fragment - CODE
08:47
Fragments (b).1 ListingsFragment - LAYOUT
02:07
Fragments (b).2 ListingsFragment - CODE
16:05
Fragments (c).1 Search Fragment - LAYOUT
00:35
Fragments (c).2 Search Fragment- CODE
13:19
RemoteRepository - FIREBASE CRUD LOGIC
21:40
Download Full Source Code
00:02
+ 3. Largest Stars Full App - CRUD + Images Upload/Download(Cloud Storage)
32 lectures 03:41:48

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.

Preview 00:38
Add Gradle Dependencies
05:53
Add Custom Fonts in Assets Folder
01:09

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.

Add Transition Animations
02:08
Modify Value Resources
04:17
Model Layout
03:39
Model Classes (a). Star
05:16
Model Classes (b). RequestCall
03:09
Global Classes (a). App
03:49
Global Classes (b). Constants
05:18
Global Classes (c). Utils
12:06
Global Classes (c). FilterHelper
07:42
Repository Classes (a). StarRepository
34:56
ViewModel Classes (a). StarViewModel
05:01
Base Classes (a). BaseActivity
08:15
Base Classes (b) - BaseEditingActivity
12:23
Adapter Classes (a) - MyAdapter
17:29
Activities (a). CRUD Activity - LAYOUT
05:40
Activities (a). CRUD Activity - CODE
26:20
Activities (b). Listings Activity - LAYOUT
02:29
Activities (b). Listings Activity - CODE
16:53
Activities (a) Splash Activity - LAYOUT
01:21
Activities (a) Splash Activity - CODE
04:55
Activities (d). Dashboard Activity - LAYOUT
03:15
Activities (d). Dashboard Activity - CODE
05:10
Activities (b). AboutUs Activity - LAYOUT
03:39
Activities (b). AboutUs Activity - CODE
02:01
Activities (a). Detail Activity - LAYOUT
06:21
Activities (b). Detail Activity - CODE
06:49

You can download the full source code below. NB/= VIDEO LESSONS ARE COMING SOON.

Download Full Source Code
00:07
Requirements
  • Be able to use Android Studio to create and run hello world project
Description

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:

  1. Firebase Realtime Database as our data store.

  2. You will learn  how to insert select update delete search and paginate/page firebase realtime database data.

  3. 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.

  4. You will learn how to apply several aggresive caching techniques like custom permannet Hard Disk caching, caching in SQLite using Room and memory caching.

  5. 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.

  6. 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:

  1. It's realtime and allows our data to be synced across a multitude of devices.

  2. It's easy to use  and integrate into our projects.

  3. It's cross platform.

  4. It is well maintained by Google engineers. There is also reasonable stability despite the updates.

  5. It has an honest free package.


Who this course is for:
  • All Students and Android Developers who want to create a full app
  • Beginner developers who want to create full android apps using latest techniques recommended by Google
  • Advanced Developers who want to start using Android Jetpack straight away without going through manuals
  • Students who want to master Firebase Realtime Database and Firebase Cloud Storage