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[
Active | Backlog |
---|---|
Forecast background colors(day,night,dawn,cloudy, etc..) | Animated weather condition shader effects |
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.
- UI: Jetpack Compose
- Database: Room database
- Networking: Retrofit
- Serialization: Kotlinx.Serialization
- DI: DaggerHilt
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
}
}
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.
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.
Weather Sample is distributed under the terms of the Apache License (Version 2.0). See the license for more information.