
Build a simple country list app with flags, names, and capitals using MVVM. Fetch data via Retrofit and JSON, use RxJava and dependency injection, and implement unit testing for reliability.
Follow along step by step to build the Android project locally, testing and solving issues as you go. Use the GitHub code or archive for reference on the architecture.
Learn about the Udemy review system, why 5-star ratings matter for course visibility, and how sharing feedback with the instructor can drive improvements.
Master the MVVM architecture by separating data presentation from business logic with model, view, and ViewModel components; boost development flexibility and testability.
Create a new Android project with an empty activity, set up MVVM architecture by organizing model, view, and view model packages, and scaffold country model and view model list.
Import the libraries for Retrofit, RxJava, Dagger, and more, set Java 1.8 compatibility, define library versions, and configure dependencies to enable building and syncing in Android Studio.
Implement the country model in the mvvm course, adding name, capital, and flag fields, and generate a constructor and getters in android studio, preparing for retrofit later.
Extend the view model from android lifecycle, define mutable live data for countries, loading, and load errors, and implement refresh that calls fetchCountries to emit mock country data for display.
Implement the main activity view for an mvvm android app by adding a swipe refresh layout, a country list recycler view, and a central progress bar with an error message.
Create an item_country layout for an Android list: image on the left, country name and capital on the right, with horizontal orientation and styles.
Create a country list adapter and view holder for a recycler view, bind country name and capital with butterknife, manage item count and updates from the backend.
Implement the main activity by binding the recycler view, loading view, error text, and swipe refresh layout with Butterknife, and observe the list view model to update the user interface.
Explore how Retrofit acts as a rest client for Android, handling json data and asynchronous network calls with RxJava for observables and observers in the view model.
Implement retrofit to connect the app to the backend API. Create a countries API with a get countries endpoint and a country service singleton using a Json converter and RxJava.
Retrieve backend data with retrofit in a list view model, manage threading and memory with composite disposable, and update live data with country models and loading state.
Implement image loading with Glide to display country flags using a util class that loads from a URL with a circular progress drawable as placeholder and error fallback.
Implement pull-to-refresh by wiring a refresh layout to call the view model's refresh and set refreshing false, then note Glide caches images to avoid backend calls.
Explore dependency injection to separate object creation from usage in the ViewModel for easier testing. See how Dagger 2 uses inject annotations, modules, and components to wire dependencies.
Learn to implement dependency injection with Dagger 2 by creating an API module and a component to inject the countries API, enabling mock testing and separating object creation from use.
Attempt to apply dependency injection to the country service in the list view model by moving creation from direct instantiation into the module, mirroring the API DI approach.
Inject the country service into the list view model using the Dagger API component and module. Run the app to display countries and prepare for unit testing.
Implement automated unit tests to verify the view model handles success and error paths from the country service, focusing on the business logic and independent of Android UI.
Set up unit test foundation for the list view model by configuring instant task executor rules and immediate schedulers to test fetch countries synchronously with a mocked country service.
Test the success path for a list view model by mocking the country service with dependency injection, returning a test single, and asserting countries, loading, and error states.
Extend the challenge by implementing the get countries failure unit test: create a test function that returns an error and verify the expected values.
Implement the error path unit test for the list view model, returning Single.error and asserting country load error is true while loading is false, then run and verify tests.
Explore MVVM architecture in Android app, using Retrofit with JSON to fetch countries and Glide for images, with RxJava connecting services and view models, and dependency injection enabling unit testing.
Learn how to make a modern Android App with this new course on Android development in Java.
Most tutorials and how to's on Udemy show you the basics of app building, but they don't show you how to use the latest technologies and libraries.
Most projects and jobs require you to know how to use the latest libraries. This is what this course is all about.
The purpose of this course is to give you a practical example of how to use these technologies, all while building a simple example app.
We will learn about:
MVVM architecture using the Google recommended Android Lifecycle Extensions
Dagger2 for dependency injection
RxJava as a reactive framework
Retrofit and JSON for remote server communication
Glide for seamless image loading
Unit tests to test the application and make it stable and robust
And we will build everything in Java
If you want to get that job as an Android Developer, you need to know how to use these technologies.
If you want to build an app that scales and is robust, these technologies will make your life easy in the long term.
Sign up today, and let's learn how to properly build a modern Android Application.
30 day money back guarantee - provided by Udemy
Highly rated instructor with over 8000 active students and growing monthly.