Skip to content

Kotlin ,MVVM , Dagger2 , Retrofit , Pagination , Moshi , RxJava , Sample APP

Notifications You must be signed in to change notification settings

myofficework000/News-Anywhere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android Architecture Sample

This is just a sample app for news reading explaining the new Architecture Guidelines written in Kotlin. This sample app is powered by NewsAPI.

Components Used

About App

This app uses NewsAPI to get various sources and each source can provide major headlines. It uses Retrofit 2 to fetch news sources and news headlines from the API and displays in a RecyclerView. It uses Room Persistence Library to provide offline functionality App first loads the data from DB and then checks for fresh data from API, API is only called if DB data is empty or expired The main aim of this sample app is show how to use the new Architecture Guidelines with Kotlin.

If you want to run:

  • Go to NewsAPI and generate an API key (It's only 2 steps!)
  • Put the API key at the bottom of the gradle.properties newsAPIKey = "YOUR_API_KEY"
  • Run the app

Architecture

The app uses ViewModel to abstract the data from UI and Repository as single source of truth for data. Repository fetch the data from database and shows, while also checks if the data is old. If the data is old or database does not contain any data (such as first launch) it fetches data from Web Service and saves the data into database.

Architecture


Screenshots

NewsApp Main Page

NewsApp Main Page

NewsApp Main Page

NewsApp Main Page

NewsApp Main Page


Future Roadmap

  • Room Persistence Library for offline support
  • Support for Launguage, Country and Category selection
  • Write test cases

Proudly 💪 made in Kotlin

About

Kotlin ,MVVM , Dagger2 , Retrofit , Pagination , Moshi , RxJava , Sample APP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages