Skip to content

zakayothuku/dvt-hiweather

Repository files navigation

DVT Weather Test

DVT Android Test project built on MVVM architecture pattern, implementing the latest and greatest tools & libraries like Retrofit, Dagger Hilt, Coroutines, Room & Work Manager among other Jetpack Libraries. It fetches data from OpenWeatherMap API.

Architecture

  • A single-activity architecture, using the Navigation Components to manage fragment operations.
  • Pattern [Model-View-ViewModel] - MVVM which facilitates a separation of development of the graphical user interface.
  • Android architecture components which help to keep the application robust, testable, and maintainable.

Technologies used:

  • Retrofit a REST Client for Android which makes it relatively easy to retrieve and upload JSON (or other structured data) via a REST based webservice.
  • Dagger Hilt for dependency injection.
  • ViewModel to store and manage UI-related data in a lifecycle conscious way.
  • LiveData to handle data in a lifecycle-aware fashion.
  • Navigation Component to handle all navigations and also passing of data between destinations.
  • Work Manager to manage Android background jobs.
  • Material Design an adaptable system of guidelines, components, and tools that support the best practices of user interface design.
  • Coroutines used to manage the local storage i.e. writing to and reading from the database. Coroutines help in managing background threads and reduces the need for callbacks.
  • Data Binding to declaratively bind UI components in layouts to data sources.
  • Room persistence library which provides an abstraction layer over SQLite to allow for more robust database access while harnessing the full power of SQLite.
  • Android KTX which helps to write more concise, idiomatic Kotlin code.

Code style

To maintain the style and quality of the code, are used the bellow static analysis tools.

Tools Config file Check command Fix command
detekt /config/detekt ./gradlew detekt ./gradlew detektFormat or ./gradlew detektAll
ktlint - ./gradlew ktlint ./gradlew ktlintFormat
spotless /spotless ./gradlew spotlessCheck ./gradlew spotlessApply
lint each module ./gradlew lint -

Setup & Installation

Clone the repository.

You require the API OPEN_WEATHER_API_KEY from Open Weather to get data. If you don’t already have an account, create one in order to request an API Key.

Add the API and Base Url for Open Weather in your local.properties file as shown then sync your project.

open.weather.key=YOUR_OPEN_WEATHER_API_KEY

You can as well install the test APK provided in the root folder for testing purposes.

Missing Features

  • Adding Favorite Locations & shows their Weather Forecast.
  • View Saved Favorites on map.

LICENSE

Apache 2.0 License

Copyright (c) 2022 Zakayo Thuku, dvt.co.za

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published