/NewsAppCleanArchitecture

A sample of a news Application that fetches data from The NewsApi and follows a clean Architecture using libraries such as Dagger Hilt , Single Activity Pattern and Retrofit for Networking

Primary LanguageKotlin

NewsAppCleanArchitecture

Getting Started

Installation

NewsAppCleanArchitecture is my playground and defination on how to go about building a modern day android Application following best practises such as a clean Architecture and making use of todays jetpack libraries, it requires a minimum API level of 16, feel free to clone the repository and shoot in a PR if you feel like something has or a pattern has been done wrong. The App makes use of the NewsApi for fetching news from its remote counterpart, please ensure to create an API KEY by signing up and then create a kotlin file/object called Secret in the root directory of the framework package and create a public Constant like these const val API_KEY = "YOUR OWN API KEY HERE" in order to run the App.

The App Makes use of some of the most popular Jetpack libraries which has been listed below

Libraries Used

  • ViewModel to store and manage UI-related data in a lifecycle conscious way.
  • LiveData to handle data in a lifecycle-aware fashion.
  • Navigation Component to handle all navigations and also passing of data between destinations.
  • Material Design
  • Coroutines used to manage the local storage i.e. writing to and reading from the database. Coroutines help in managing background threads and reduces the need for callbacks.
  • Data Binding to declaratively bind UI components in layouts to data sources.
  • Room persistence library which provides an abstraction layer over SQLite to allow for more robust database access while harnessing the full power of SQLite.
  • Android KTX which helps to write more concise, idiomatic Kotlin code.

Architecture

The architecture of this application relies and complies with the following points below:

Modules

The App is very much modularised into different packages to ensure a clean design code all of which performs different roles in the MVVM Structure of the App. Those packages includes.

  • business
  • di
  • framework

Which encapsulates the apps core features with business handling most of the Apps core logic such as network request and database caching.

Screenshots