- Learning Architecture is an important step when learning software development.
- Architectures are hard to learn since there are so many of them.
- Most of tutorials found in Internet introduce too many concepts at the same time and it is hard to follow for most of beginners.
- You should have some basic knowledges of Object-Oriented programming.
- You should have some basic knowledges of Android development.
- You should have installed all required development tools for Android development on your machine.
Hands-on coding:
- Kotlin
- Android platform:
- Android's Jetpack:
- Android's Architecture Components:
- Testing
We will implement a cat images browsing app with the following features:
- Fetching list of cat images from TheCatAPI.
- Displaying fetched images in a grid layout.
- Using recommended techniques and frameworks from Google to implement the app using MVVM architecture step by step.
- Implementing the app in an incremental process, starting with a pure Kotlin implementation to a full-blown MVVM-based implementation using frameworks in Android's Architecture Components and popular 3rd-party frameworks.
After finishing the course, you'll have hopefully learned intuitively how the MVVM Architecture works by implementing a simple app by using different popular frameworks provided by Google and 3rd parties. Depending on your motivation and the level of knowledge, you can follow different paths forward to learn more about Android development.
Try to apply what you have learnd in another app that uses the dog api instead. With this approach, you will have more or less the same structure for you app but you have to deal with a different data model, a different api.
There are two options to learn even more:
-
Extending the current cat app by implementing additional features such as:
- users can favorite images, the information of favorite images should be persisted locally in some kinds of database, and there should be an additional screen to show such favorite images
-
Implementing a completely different app using public or private APIs to try out different techniqures:
- Github App using Github API
- News App using newsapi.org
- Image browsing apps using Unsplash or Pixabay APIs
- ....
There are a list of public APIs that you can use to implement your next sample app here https://github.com/public-apis/public-apis
Everyone of us has an idea (or multiple ideas) for a killer app (or apps). Go forward and realize your dreams. You will be proud of yourself afterward :)
This basic project is implemented in pure Kotlin and built-in frameworks from the Android SDK and doesn't use any 3rd party frameworks.
- Volley is used for Networking.
- Gson is used for Deserializing of JSON response.
- Picasso is used for displaying & caching of image data.
- Retrofit is used for Networking.
- Moshi is used for Deserializing of JSON response.
- Glide is used for displaying & caching of image data.
Resources:
- How-To: Retrofit, Moshi, Coroutines & Recycler View for REST Web Service Operations with Kotlin for Android
- Using Glide with Kotlin
Resources:
Resources:
Inject the repository directly into the ViewModel
- Folder structure
- Multiple ViewModels
- Multiple
Dagger
modules - Caching using
Room
Resources:
- PagedList Component.
- NetworkState in ImageDataSource
Resources:
- Clean architecture with interfaces for use cases.
- Inject key from gradle and BuildConfig: https://github.com/PhilippeBoisney/GithubApp/blob/master/app/build.gradle
- View binding.
- MultiBinding with Dagger: (used to inject a viewmodel into its corresponding Activity/Fragment)
- Check Internet connection
- Multi-modules
- Add SurpervisorJob into ImageDataSource
- Cache the list in
Room
- Build-time code generation (Dagger) vs Runtime dependency injection.
Resources:
- Playing with… Paging Library, Retrofit, Coroutines, Koin & Testing.
- Boost your Android apps with Koin and Coroutines using MVVM in Kotlin
- Android Architecture starring Kotlin Coroutines, Jetpack (MVVM, Room, Paging), Retrofit and Dagger 2
- Android - MVVM using Dagger,room,navigation controller,Rx,Livedata,Retrofit
- Android MVVM with Dagger 2, Retrofit, RxJava, Architecture Components
- MVVM with Kotlin — Android Architecture Components, Dagger 2, Retrofit and RxAndroid