Coder Social home page Coder Social logo

news-app's Introduction

News-App - MVVM architecture

Major Highlights

  • Jetpack Compose for modern UI Toolkit.
  • Offline caching with a single source of truth.
  • MVVM architecture for a clean and scalable codebase.
  • Kotlin and Groovy.
  • 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.
  • Custom Tabs for a seamless reading experience directly within the app.
  • WorkManager for periodic news fetching.
  • Notification for alerting about latest news.
  • Coil for efficient image loading.

mvvm-architecture

Features Implemented

  • Show top news articles.
  • News by country, language, and source.
  • Search for specific news articles.
  • View news articles in a Android browser Custom Tabs for a detailed reading experience.
  • Implements a caching mechanism to store news articles locally. Allows users to access previously viewed top news articles even when offline.
  • Implements pagination for efficient loading of large sets of news articles.

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/mayursarode4/News-App.git
cd News-App
  • Visit newsapi.org and sign up for an API key, Copy the API key provided
  • Open the build.gradle 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

└───com
    └───mayursarode
        └───newsapp
            │   NewsApplication.kt
            │
            ├───data
            │   ├───api
            │   │       ApiKeyInterceptor.kt
            │   │       NetworkService.kt
            │   │
            │   ├───local
            │   │   ├───dao
            │   │   │       ArticleDao.kt
            │   │   │
            │   │   ├───database
            │   │   │       DatabaseService.kt
            │   │   │       NewsDatabase.kt
            │   │   │       NewsDatabaseService.kt
            │   │   │
            │   │   └───entity
            │   │           Article.kt
            │   │           Source.kt
            │   │
            │   ├───model
            │   │       ApiArticle.kt
            │   │       ApiSource.kt
            │   │       Country.kt
            │   │       Language.kt
            │   │       NewsSourcesResponse.kt
            │   │       TopHeadlinesResponse.kt
            │   │
            │   └───repository
            │           CountryRepository.kt
            │           LanguageRepository.kt
            │           NewsBySourcesRepository.kt
            │           NewsSourcesRepository.kt
            │           SearchRepository.kt
            │           TopHeadlinesPagingSource.kt
            │           TopHeadlinesRepository.kt
            │
            ├───di
            │   │   qualifiers.kt
            │   │
            │   └───module
            │           ApplicationModule.kt
            │
            ├───navigation
            │       NewsNavigation.kt
            │       Screen.kt
            │
            ├───ui
            │   │   HomeScreen.kt
            │   │   MainActivity.kt
            │   │
            │   ├───base
            │   │       BaseViewModel.kt
            │   │       CommonUI.kt
            │   │       UiState.kt
            │   │
            │   ├───country
            │   │       CountryListScreen.kt
            │   │       CountryListViewModel.kt
            │   │
            │   ├───language
            │   │       LanguageListScreen.kt
            │   │       LanguageListViewModel.kt
            │   │
            │   ├───newsbysources
            │   │       NewsBySourcesScreen.kt
            │   │       NewsBySourcesViewModel.kt
            │   │
            │   ├───newssources
            │   │       NewsSourcesScreen.kt
            │   │       NewsSourcesViewModel.kt
            │   │
            │   ├───search
            │   │       SearchScreen.kt
            │   │       SearchViewModel.kt
            │   │
            │   ├───theme
            │   │       Color.kt
            │   │       Theme.kt
            │   │       Type.kt
            │   │
            │   └───topheadlines
            │       ├───offline
            │       │       TopHeadlinesOfflineScreen.kt
            │       │       TopHeadlinesOfflineViewModel.kt
            │       │       
            │       ├───online
            │       │       TopHeadlinesOnlineScreen.kt
            │       │       TopHeadlinesOnlineViewModel.kt
            │       │
            │       └───paging
            │               TopHeadlinesPagingScreen.kt
            │               TopHeadlinesPagingViewModel.kt
            │
            ├───utils
            │   │   Constants.kt
            │   │   DispatcherProvider.kt
            │   │   LocalData.kt
            │   │   ResourceProvider.kt
            │   │   TimeUtil.kt
            │   │
            │   ├───logger
            │   │       AppLogger.kt
            │   │       Logger.kt
            │   │
            │   └───network
            │           DefaultNetworkHelper.kt
            │           NetworkHelper.kt
            │
            └───worker
                    NewsWorker.kt



App Screenshots:

screenshots 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 😄

🚀 About Me

Hi there! My name is Mayur Sarode, I work as a Senior Android Developer and eager to expand knowledge.

Lets connect, feel free to reach out to me on :

news-app's People

Contributors

mayursarode4 avatar

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.