Skip to content

A Sample weather app written entirely with Kotlin and Jetpack Compose, following android best practices.

License

Notifications You must be signed in to change notification settings

aarash709/Weather

Repository files navigation

Weather Sample

Work in progress [🚧] sample android weather app written entirely in Kotlin and jetpack compose. The app is fully functional and following offline first best practices. This is a demo and is not a production ready app[⚠️]. Contributions are welcomed🫡.

Roadmap

Active Backlog
Forecast background colors(day,night,dawn,cloudy, etc..) Animated weather condition shader effects

Architecture

This project is leveraging hybrid model architecture(by layer + by feature)

  • app primarily managing navigation logic.
  • Feature Ui code and navigation setup for each page.
  • Core has separate modules for networking and offline cache and shared code across application.
  • WorkManager for fetching remote data in the background.

Stack

Data

Data is provided by OpenWeatherMap V2.5. To get started and make the app work, you need to get a key. Go to the OpenWeatherMap and generate a key(which will be a v2.5 an NOT V3.0) then copy the key to local.properties and then past it for the API_KEY property. Sync the gradle and you are good to go. Your local.properties file shoud have the following proprties:

BASE_URL=https://api.openweathermap.org/
API_KEY=[GeneratedApiKey]

To access to these properties and if you are using AGP 8.1 an up, you need to set buildConfig to true in your module`s build.gradle.kts file like this:

android{

  buildFeatures {
    buildConfig = true
  }
}

Code Analisis

This project is using static code analysis tools. Detekt and Kotlinter is used for styling and code smells. Detekt is using a *.yml file located at config/detekt/config.yml, which is currently customised to meet the project needs. Kotlinter however can be configured using .editorconfig file and ktlint rules.

Git hooks

Copy files in git-hooks/*.sh to .git directory to enable pre commit and pre push checks. These files can be copied automatically using a gradle task if you will.

License

Weather Sample is distributed under the terms of the Apache License (Version 2.0). See the license for more information.

About

A Sample weather app written entirely with Kotlin and Jetpack Compose, following android best practices.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published