At this point you probably already know how to build an app, but are you confident that you are following the market best practices? How would your app perform with millions of users? How clean and testable is your codebase?
Those questions were asked in many interviews during my 8+ years of experience in Android, and you not only need to know what to answer but also how to build it.
At this point you probably already know how to build an app, but are you confident that you are following the market best practices? How would your app perform with millions of users? How clean and testable is your codebase?
Those questions were asked in many interviews during my 8+ years of experience in Android, and you not only need to know what to answer but also how to build it.
In this course you will learn all that while building an e-commerce app. This app will consist of a list of products and a product details screen, where we will fetch the data from an API call and we will also save some data locally in the device.
We will talk about the layers of the Clean Architecture and start building our app by the View layer. Then we will talk a lot about Coroutines, Lifecycle, Scope, Dispatchers and ViewModel, and how we will use those concepts to asynchronously fetch data in combination with Retrofit. The communication between the Model/Business layer and the View will be implemented using the concept of ViewState and LiveData, we will also navigate and pass data between screens using the Navigation Component. We will also talk about the SOLID principles and implement a Dependency Injection library. At the end, we will save data in a Database using Room and talk about Error Handling.
Let's not forget about Testing, we will be writing test for all parts of our app.
During this course you will be coding the whole time and we will see improvements being made in our app in every section.
This is the moment for you to get that dream job, a promotion or build a maintainable app with quality code.
For every lecture, there will be a specific branch for that, for example lecture-4, lecture-5, and so forth.
REMEMBER… Quality is essential. And there is a full 30 DAY-money-back guarantee case you don't like it ;)
Explaining how the course is structured.
Short introduction about the app we will build during the course.
Link for the project here:
https://github.com/renaro/ecommerce-android-app
In this video I explain about Clean Architecture for Android and how we intend to implement it while also following the Google's guideline for architecture and with the Jetpack components. Don't worry if you don't understand all the components of the architecture yet, each component and layer will be explained soon.
Time to start coding, we will start with the View Layer. We will use the concept of ViewState to describe a View(Fragment/Activity). We will see how we can define a ViewState for the Product List screen. Checkout to the following branch : git checkout initial-viewstates
In this video we will talk about ViewModel and Live Data, probably one of the most important pieces of Android Development nowadays. Pretty much every screen will need a ViewModel, it will help you to keep the Fragment/Activities clean.
Check the code in the following branch: git checkout viewmodel-livedata
Pretty much all successful applications out there uses the Internet to fetch and save data somewhere, and if your app does not handle it correctly it could be a disaster. In this class we will talk about asynchronous operations and how to do it right.
This is the implementation part of the previous video, here we will implement coroutine to execute a suspend-able function to retrieve a list of products. Checkout the code in the following branch: git checkout coroutines
Retrofit is by far the most used library for HTTP requests in Android. Here we add it to our project and use it to retrieve the product list from an API. Checkout the code in the following branch: git checkout retrofit
Since this course we are focusing in architecture and quality, we have to talk about the SOLID principles, some design principles that could guide you to implement a clean and maintainable codebase.
In this video we go over an example of how the dependency injection will help us to maintain our project in the long run.
Here we implement HILT, a dependency injection library in our project, the reason why I chose this one is because it is mentioned by Google when they explain Dependency Injection.This type of libraries are mainly used to avoid the boilerplate(amount of code) necessary to accomplish the providing of dependencies. Checkout to the following branch: git checkout hilt
At this point we have implemented a whole feature, the product list, and we have all layers, but the code is still mixed up, in this video I will show some examples of how you can organize the packages in your project.
Checkout to the following branches:
git checkout packages-by-feature
git checkout packages-by-layer
At this point we already know how to implement the 3 layers of our clean architecture, now it is time to implement a new feature, the Wishlist. This time we will implement in the right way from the beginning since we already have the theory background. We will start with the View Layer and defining how our repository will look like.
Checkout to the branch: git checkout wishlist-part-1
Now we will implement the repository, we will use Room, another Jetpack component for database. We will go over the basics of Room and implement all the steps to save the products in the wishlist in the Database.
Checkout to the branch: git checkout wishlist-part-2
We will introduce a new concept for this feature: Use Cases. Imagine that you own an E-commerce, adding a product to the wish list is an use case and the same is true for checking if a product is in your wish list. So we will add those two use cases and use it in our code.
Checkout to the branch: git checkout wishlist-part-3
Testing is essential ! It will never be enough to stress that testing is an essential piece in a clean and maintainable codebase. In this class we talk about the basics of testing in Android what are the suggestions of Google on that. Even though it is the last section of the course, it doesn't mean you should start writing tests in the end of your project, quite the contrary, the sooner the better. The reason why we talking about tests this late in the course is because now all the layers are know and we can test them all.
Here we will mainly test the use cases, from our business/domain layer. We will write unit tests for it.
Check the code : git checkout testing-repo-and-usecases
Here we will mainly test the ViewModel.
Check the code : git checkout testing-view-model
Adding error handling for product list.
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.