News App is a simple news app that fetches top headline news from NewsAPI
- You will require latest version of Android Studio 3.0 (or newer) to be able to build the app
- Android Studio Bumblebee | 2021.1.1 Patch 2 or Higher
- Language: Kotlin
- Build System: Gradle
You'll need to provide API key to fetch the news from the News API Service. Currently the news is fetched from NewsAPI
- Generate an API key (It's only 2 steps!) from NewsAPI
- Create new file named ->
secrets.properties
in our project root folder - Add the API key as shown below [Make sure to keep the double quotes]:
API_KEY = "<INSERT_YOUR_API_KEY>"
- Build the app
- Enjoyyyyy 🎉
The app uses MVVM (Model View View Model) architecture to have a unidirectional flow of data, separation of concern, testability, and a lot more.
-
Tech Stack
- Kotlin - First class and official programming language for Android development.
- Android Jetpack https://developer.android.com/topic/libraries/data-binding/
- Data Binding - A support library that allows you to bind UI components in your layouts to data sources in your app using a declarative format rather than programmatically.
- LiveData - An observable,lifecycle-aware data holder.
- Room - a persistence library provides an abstraction layer over SQLite.
- Lifecycle - perform action when lifecycle state changes.
- ViewModel - store and manage UI-related data in a lifecycle conscious way.
- Paging 3 - Pagination Library
- Kotlin coroutines - Executing code asynchronously.
- Retrofit - Type-safe HTTP client for Android and Java and Kotlin by Square, Inc.
- Moshi - A modern JSON library for Android, Java and Kotlin
- OkHttp interceptor - Logs HTTP requests and responses
- Flow - An asynchronous version of a Sequence, a type of collection whose values are lazily produced. Flow handles the stream of data asynchronously that executes sequentially.
- KOIN - a pragmatic lightweight dependency injection framework.
-
Gradle
- Gradle Kotlin DSL - For reference purposes, here's an article explaining the migration.
- Plugins
- Ktlint - creates convenient tasks in your Gradle project that run ktlint checks or do code auto format.
-
CI/CD
- Github Actions