/MyWeatherForecastApp

WeatherForecast Test Application

Primary LanguageKotlin

MyWeatherForecastApp

WeatherForecast Test Application

How To Build

  • download the SouceCode and then unzip the file

  • open with android studio

  • go to open File -> Open -> select source code root folder (MyWeatherForecastApp-master) and then waiting for library downloading and build the project.

  • unzip the file project

  • open with android studio project

  • selected the project source code project

  • waiting for the building process project

  • if build is done then press "run" to run the project project

  • source code structure project

Project Structure & Libraries

  • MVVM + Clean Architecture
  • Modular Architecture
  • Koin Dependency Injection
  • Jetpack Room, Navigation Component, DataBinding, DataStore, Paging3
  • Retrofit for Networking
  • Airbnb Epoxy : for building complex screens in a RecyclerView
  • Coil : Image Loading library
  • Coroutines + Asynchronous Flow : for working asynchronous and handling long running task

reusability Implement

  • for reuse to support for 7-day forecast
  • assume it need to call for another API to get the Data.
  • first go to data module and add the API endpoint with request and response model
  • and do implement for getting data from API in repository, dataSource
  • in domain layer then create a Usecase class that call for getting data from the repository
  • the presentation layer in HomeViewModel. the function "loadHomeUiData" is responsible to getting data from usecase and create a UI model to render.
  • with seal class "HomeUiModel". it the place to decide the type of UI layout we want.

project

  • getting data from 7-day forecast is handle in function "loadHomeUiData" with combine operation so we can merge data from another API and mapping the sequence of the UI here.

project

  • in the "ResultToHomeUiModelMapper" is where to handle for sequence of layout we want to render in homeFragment

project

  • in the "HomeUiController" is where to render the UI layout according with the xml layout and binding the data to show

project

  • with the Epoxy library, we can now flexible to reuse and adjust the layout in UI and this is layout structure in the app.

project

Demo

project