News App is a simple news app which uses NewsAPI to fetch top news headlines from the API.
The codebase focuses 👓 on following key things:
- Code structuring, style and comments
- Dependency injection 🗡
- Offline first
✈️ - Kotlin + Coroutines
- And tests 🛠
- Emojis (ofcourse) 😛
The idea is to keep the app super simple while demonstrating new libraries and tools which makes it easier to build high quality Android applications.
You will require latest version of Android Studio 3.0 (or newer) to be able to build the app
You'll need to provide API key to fetch the news from the News Service (API). Currently the news is fetched from NewsAPI
- Generate an API key (It's only 2 steps!) from NewsAPI
- Create new file named ->
credentials.properties
in our project root folder - Add the API key as shown below [Make sure to keep the double quotes]:
NEWS_API_KEY = "<INSERT_YOUR_API_KEY>"
- Build the app
- Enjoyyyyy 🎉
News App uses libraries and tools used to build Modern Android application, mainly part of Android Jetpack 🚀
- Kotlin first
- Coroutines and Flow first
- Architecture components
- Dagger 2 for dependency injection 🗡
- Retrofit
The app uses MVVM [Model-View-ViewModel] architecture to have a unidirectional flow of data, separation of concern, testability, and a lot more.
Read more:
The following diagram shows the dependency graph of the app.
Generated by Daggraph
Trying to learn the new Architecture Components. I have wrote a series of articles to understand Android Architecture Components. Feel free to check it out to learn more.