Giter VIP home page Giter VIP logo

newsapp's Introduction

NewsApp

Welcome to NewsApp, a news application built with MVVM architecture and Jetpack Compose.

Major Highlights

  • Jetpack Compose for modern UI
  • Offline caching with a single source of truth
  • MVVM architecture for a clean and scalable codebase
  • Kotlin and Kotlin DSL
  • Dagger Hilt for efficient dependency injection.
  • Retrofit for seamless networking
  • Room DB for local storage of news articles
  • Coroutines and Flow for asynchronous programming
  • StateFlow for streamlined state management
  • Pagination to efficiently load and display news articles
  • Unit tests and UI tests for robust code coverage
  • Instant search for quick access to relevant news
  • Navigation for smooth transitions between screens
  • WebView for a seamless reading experience
  • WorkManager for periodic news fetching
  • Notification for alerting about latest news
  • Coil for efficient image loading
  • Pull to refresh for refreshing news content
  • Swipe to delete for managing saved news articles

mvvm-architecture

Features Implemented

  • Show top news articles
  • Filter news by country, language, and source
  • Save news articles for future reference
  • Search for specific news articles
  • View news articles in a WebView for a detailed reading experience

Dependency Use

  • Jetpack Compose for UI: Modern UI toolkit for building native Android UIs
  • Coil for Image Loading: Efficiently loads and caches images
  • Retrofit for Networking: A type-safe HTTP client for smooth network requests
  • Dagger Hilt for Dependency Injection: Simplifies dependency injection
  • Room for Database: A SQLite object mapping library for local data storage
  • Paging Compose for Pagination: Simplifies the implementation of paginated lists
  • Mockito, JUnit, Turbine for Testing: Ensures the reliability of the application

How to Run the Project

  • Clone the Repository:
git clone https://github.com/khushpanchal/NewsApp.git
cd NewsApp
  • Visit newsapi.org and sign up for an API key, Copy the API key provided
  • Open the build.gradle.kts file in the app module. Find the following line
buildConfigField("String", "API_KEY", "\"<Add your API Key>\"")
  • Replace "Add your API Key" with the API key you obtained
  • Build and run the NewsApp.

The Complete Project Folder Structure

|── NewsApplication.kt
├── common
│   ├── Const.kt
│   ├── NoInternetException.kt
│   ├── dispatcher
│   │   ├── DefaultDispatcherProvider.kt
│   │   └── DispatcherProvider.kt
│   ├── logger
│   │   ├── AppLogger.kt
│   │   └── Logger.kt
│   ├── networkhelper
│   │   ├── NetworkHelper.kt
│   │   └── NetworkHelperImpl.kt
│   └── util
│       ├── EntityUtil.kt
│       ├── NavigationUtil.kt
│       ├── TimeUtil.kt
│       ├── Util.kt
│       └── ValidationUtil.kt
├── data
│   ├── database
│   │   ├── AppDatabaseService.kt
│   │   ├── ArticleDatabase.kt
│   │   ├── DatabaseService.kt
│   │   ├── dao
│   │   │   ├── ArticleDao.kt
│   │   │   └── SavedArticleDao.kt
│   │   └── entity
│   │       ├── Article.kt
│   │       ├── SavedArticleEntity.kt
│   │       ├── SavedSourceEntity.kt
│   │       └── Source.kt
│   ├── model
│   │   ├── ApiArticle.kt
│   │   ├── ApiSource.kt
│   │   ├── Country.kt
│   │   ├── Language.kt
│   │   ├── News.kt
│   │   └── Sources.kt
│   ├── network
│   │   ├── ApiInterface.kt
│   │   └── ApiKeyInterceptor.kt
│   └── repository
│       └── NewsRepository.kt
├── di
│   ├── module
│   │   └── ApplicationModule.kt
│   └── qualifiers.kt
├── ui
│   ├── NewsActivity.kt
│   ├── base
│   │   ├── CommonUI.kt
│   │   ├── NewsDestination.kt
│   │   ├── NewsNavigation.kt
│   │   └── UIState.kt
│   ├── components
│   │   ├── Article.kt
│   │   ├── FilterItem.kt
│   │   ├── FilterItemListLayout.kt
│   │   └── NewsListLayout.kt
│   ├── paging
│   │   └── NewsPagingSource.kt
│   ├── screens
│   │   ├── ArticleScreen.kt
│   │   ├── FilterScreen.kt
│   │   ├── NewsScreen.kt
│   │   ├── SavedScreen.kt
│   │   └── SearchScreen.kt
│   ├── theme
│   │   ├── Color.kt
│   │   ├── Theme.kt
│   │   └── Type.kt
│   └── viewmodels
│       ├── NewsViewModel.kt
│       ├── SearchViewModel.kt
│       ├── SharedViewModel.kt
│       └── filters
│           ├── CountryFilterViewModel.kt
│           ├── LanguageFilterViewModel.kt
│           └── SourceFilterViewModel.kt
└── worker
    └── NewsWorker.kt

screenshots

If this project helps you, show love ❤️ by putting a ⭐ on this project ✌️

Contribute to the project

Feel free to improve or add features to the project. Create an issue or find the pending issue. All pull requests are welcome 😄

Other projects

I have also created RVTimeTracker - RecyclerView Time Tracker, a finely crafted library designed to accurately calculate viewing time for each item in RecyclerView. Check it out - RVTimeTracker

newsapp's People

Contributors

khushpanchal avatar

Stargazers

R R avatar  avatar vdbhb59 avatar Amit Yadav avatar Norbert avatar  avatar Hossam Ahmed avatar Muhammad Atif Rashid avatar Droid aman avatar Faiz Ikhwan avatar Numan Ali avatar tinyfight avatar Guhuaiyu avatar Rafal. avatar Abdul Kayuem avatar abaferas avatar Jefferson Huang avatar ahmed elsawwah avatar Egbuna Chukwudi avatar  avatar  avatar Sathyapriyan U avatar Chirag Thummar avatar Nitin Londhe avatar Sidharth Kapoor avatar  avatar Hưng Nguyễn avatar Ravi Yadav avatar swapnil lanjewar avatar KartikG avatar Vaishnavi Srivastava avatar Eslam Ghazy avatar 旅立ちの風 avatar  avatar Abhay Tomar avatar Animasahun Ibrahim (teewhydope) avatar Satish Vanjara avatar glumes avatar Adarsha Nayak avatar Md. Imam Hossain avatar Matthew Xu avatar Javier de la Vega  avatar Irfan Nawawi avatar Abiodun Osifowokan avatar Ratnesh avatar  avatar Anshuman Singh avatar Mohamed Ragab avatar  avatar Imam Yusuf Bachtiar avatar  avatar MagdyEl-Sayed avatar jamilxt avatar Mohamed Aboalanain avatar Sara Salah avatar Sanjay Rathore avatar Ayush shrivastava avatar  avatar  avatar Hazman Badrunsham avatar abhinesh chandra avatar Mel SARDES avatar Dhiraj Singh Dafouti avatar Mhmd Dsoki avatar Shreyas Phadtare avatar ilham avatar Hemant Kumar Giri avatar Ahmed Swilam avatar Sohail avatar  avatar AMIT SHEKHAR avatar Ah_Abdelhak avatar Khush Panchal avatar RumitPatel avatar

Watchers

 avatar Hazman Badrunsham avatar  avatar  avatar

newsapp's Issues

Runtime Permission for Notification

Starting Android 13, notifications are off by default, add runtime permission for notifications.
Currently notification is shown on every successful fetch by WorkManger once a day.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.