/NewsApp-MVVM

This Android Application employs an MVVM architecture, leveraging Jetpack Compose, Kotlin, Retrofit, Coroutines, Flow, StateFlow, Dagger-Hilt, WorkManager, Room among other technologies.

Primary LanguageKotlin

NewsApp with MVVM Architecture


git banner for mvvm repo new



The repository takes you on an extensive Android development journey using the MVVM architecture, powered by cutting-edge technologies, showcased through various branches.

  1. with_xml_and_dagger) :
    Initial implementation featuring traditional UI with XML layouts, employing Dagger 2 for dependency injection.
  2. with_xml_and_dagger_hilt:
    Evolutionary stage integrating Hilt, transitioning from Dagger 2, while retaining XML layouts.
  3. with_jetpack_compose_and_hilt:
    Advanced transformation phase, integrating Dagger Hilt alongside the transition from XML layouts to Jetpack Compose, marking a modernized UI approach.
  4. main :
    The final version incorporates Jetpack Compose for the user interface, Dagger Hilt for managing dependencies, and Room database for handling data, making it the most up-to-date iteration of the architecture.


Fuled with bellow technologies

  • MVVM Architecture
  • Kotlin
  • Dagger2
  • Hilt
  • Retrofit
  • Coroutines
  • Stateflow
  • Flows and operators
  • View binding
  • Jetpack Compose
  • Room database
  • Worker
  • Navigation with Compose


Features Implemeted

  • News Fetching
  • Top Headlines
  • News by Source
  • News by Country
  • News by Language
  • Search News by Text
  • Offline Mode
  • Automatic Morning News Fetch using Worker
  • Notifications after News Fetch
  • Pagination for Top Headlines


Application Architecture

mvvm_archetecture



Application's package and file structure is depicted bellow

.
`-- com
`-- sanket
`-- newsapp
|-- NewsApplication.kt
|-- apputils
|   |-- Constants.kt
|   |-- IOUtils.kt
|   |-- NetworkHelper.kt
|   |-- NetworkHelperImpl.kt
|   |-- TimeUtil.kt
|   |-- logger
|   |   |-- AppLogger.kt
|   |   `-- Logger.kt
|   `-- typealias.kt
|-- data
|   |-- api
|   |   |-- HeaderInterceptor.kt
|   |   `-- NetworkService.kt
|   |-- local
|   |   |-- AppDatabase.kt
|   |   |-- AppDatabaseService.kt
|   |   |-- DatabaseService.kt
|   |   |-- dao
|   |   |   `-- NewsArticlesDao.kt
|   |   `-- entity
|   |       |-- Article.kt
|   |       `-- Source.kt
|   |-- model
|   |   |-- ApiArticle.kt
|   |   |-- ApiSource.kt
|   |   |-- Country.kt
|   |   |-- Language.kt
|   |   |-- NewsSourcesResponse.kt
|   |   `-- TopHeadlineResponse.kt
|   `-- repository
|       |-- CountriesRepository.kt
|       |-- LanguagesRepository.kt
|       |-- NewsSourceRepository.kt
|       |-- TopHeadlinePagingSource.kt
|       `-- TopHeadlineRepository.kt
|-- di
|   |-- module
|   |   |-- ActivityModule.kt
|   |   `-- ApplicationModule.kt
|   `-- qualifier.kt
|-- notifications
|   `-- NotificationHelper.kt
|-- ui
|   |-- base
|   |   |-- BaseActivity.kt
|   |   |-- CommonUi.kt
|   |   |-- NewsNavHost.kt
|   |   `-- UiState.kt
|   |-- countries
|   |   |-- CountriesScreen.kt
|   |   `-- CountriesViewModel.kt
|   |-- home
|   |   |-- HomeActivity.kt
|   |   `-- HomeScreen.kt
|   |-- language
|   |   |-- LanguageViewModel.kt
|   |   `-- LanguagesScreen.kt
|   |-- newssource
|   |   |-- NewsSourceViewModel.kt
|   |   `-- SourcesScreen.kt
|   |-- offlinearticle
|   |   |-- OfflineArticleScreen.kt
|   |   `-- OfflineArticleViewModel.kt
|   |-- pagination
|   |   |-- PaginationTopHeadlineScreen.kt
|   |   `-- PaginationTopHeadlineViewModel.kt
|   |-- search
|   |   |-- SaerchScreen.kt
|   |   `-- SearchViewModel.kt
|   |-- theme
|   |   |-- Color.kt
|   |   |-- Theme.kt
|   |   `-- Type.kt
|   `-- topheadline
|       |-- TopHeadLineScreen.kt
|       `-- TopHeadlineViewModel.kt
`-- worker
`-- NewsWorker.kt


Screenshots

image


🚀 About Me

Hello!

I am Sanket Patel, a Lead Android Developer with a passion for coding and technology. I specialize in crafting innovative solutions and thrive on challenges. During the day, I'm fully immersed in app development, and after hours, I stay up-to-date with the latest tech trends. If you have any questions or need assistance with anything Android-related, let's connect and dive into all things software development together!