A Clean and Elegant Android Weather Application
Features โข Tech Stack โข Quick Start โข Architecture โข Contributing
WeaKnow is an Android application focused on providing accurate and timely weather information services. Through the combination of "localized data + multi-source API + intelligent background synchronization", it provides users with a one-stop weather experience including real-time weather, hourly/daily forecasts, air quality, and life indices.
- Accuracy & Timeliness: Based on Amap (Gaode Maps) positioning and QWeather API, combined with local database caching and periodic background synchronization to ensure data freshness and stability
- Multi-location Management: Supports adding, switching, and deleting multiple cities or locations to meet diverse needs such as cross-city travel and hometown monitoring
- Visual & Interaction: Adopts Material Design 3 theme and Lottie dynamic backgrounds, automatically switching background animations based on weather types to enhance user experience
- ๐ก๏ธ Real-time Weather Information - Current temperature, feels-like temperature, weather phenomena, wind direction and speed, and other real-time data
- โฐ Hourly Weather Forecast - 6-24 hour weather trends with temperature curve visualization
- ๐ Future Weather Forecast - 7-15 day weather predictions including high/low temperatures, precipitation probability, humidity, and other detailed metrics
- ๐ฌ๏ธ Air Quality Monitoring - AQI index, major pollutant concentrations, and air quality level visualization
- ๐ Life Index Reminders - Multi-dimensional life advice including clothing, car washing, UV index, and sports
- ๐ Multi-location Management - Supports adding, switching, and deleting multiple cities for quick weather checks in different regions
โ ๏ธ Weather Warning Notifications - Real-time push notifications for meteorological disaster warnings- ๐จ Smart Background Animation - Automatically switches Lottie dynamic backgrounds based on weather types
- ๐ Intelligent Background Synchronization - Four-level synchronization strategy (real-time/short-term/mid-term/long-term) balancing data freshness and battery consumption
- ๐พ Offline Availability - Room local cache allows viewing historical data in weak or no network environments
- ๐ฏ Material Design 3 - Follows the latest design specifications, supports dynamic colors and dark mode
- โก Coroutine Concurrency - Multi-interface concurrent requests improve data synchronization efficiency
- ๐๏ธ MVVM Architecture - Clear layered design, easy to maintain and extend
| Technology | Description |
|---|---|
| Kotlin | Primary development language |
| Jetpack Compose | Modern UI toolkit |
| Material Design 3 | UI design specification |
| MVVM | Architecture pattern |
| Room | Local database |
| Retrofit + OkHttp | Network requests |
| WorkManager | Background task scheduling |
| Koin | Dependency injection |
| Coroutines + Flow | Asynchronous programming |
| Lottie | Animation rendering |
- QWeather API - Weather data source
- Amap (Gaode Maps) API - Positioning and geocoding services
- Android Studio Arctic Fox or higher
- JDK 17+
- Android SDK 35
- Gradle 8.10.2
git clone https://github.com/LvJujin/WeaKnow.git
cd WeaKnow- Create a
local.propertiesfile in the project root directory - Add the following configurations:
# QWeather API Key
QWEATHER_WEB_API_KEY=your_qweather_api_key
# Amap API Keys
AMAP_WEB_API_KEY=your_amap_api_key
AMAP_ANDROID_API_KEY=your_amap_android_key
# Application Signature SHA1
CERT_SHA1=your_cert_sha1- Open the project with Android Studio
- Wait for Gradle synchronization to complete
- Connect an Android device or start an emulator
- Click the run button
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ UI Layer โ
โ (Compose UI, Activity, Screen) โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโ
โ ViewModel Layer โ
โ (State Management, Logic) โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโ
โ Repository Layer โ
โ (Data Coordination, Cache) โ
โโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโ
โ โ
โโโโโโโผโโโโโโโโโ โโโโโโโโผโโโโโโโโ
โ Remote API โ โ Local Databaseโ
โ (Retrofit) โ โ (Room) โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
- Repository: Encapsulates data access logic, coordinates remote API and local database
- DAO: Room data access objects, defines database operations
- Entity: Database entity models
- API Client: Retrofit service interfaces, encapsulates network requests
- ViewModel: Manages UI state, handles business logic
- Worker: Background synchronization tasks, ensures data freshness
- UseCase: Business use case encapsulation (if applicable)
- Activity: Application entry point, permission management, navigation control
- Screen: Compose page components
- Component: Reusable UI components
- Theme: Theme and style definitions
| Sync Type | Frequency | Data Content |
|---|---|---|
| Real-time Sync | 15 minutes | Real-time weather, warning information |
| Short-term Sync | 30 minutes | Hourly forecast, air quality |
| Mid-term Sync | 1 hour | Multi-day forecast |
| Long-term Sync | 6 hours | Weather indices |
Note: Please add actual screenshots based on the application interface
app/src/main/
โโโ kotlin/me/ljj/weaknow/
โ โโโ application/ # Application class
โ โโโ ui/ # UI Layer
โ โ โโโ activity/ # Activities
โ โ โโโ screen/ # Screen components
โ โ โโโ component/ # Reusable components
โ โ โโโ layout/ # Layout components
โ โ โโโ dialog/ # Dialogs
โ โ โโโ theme/ # Theme styles
โ โโโ viewmodel/ # ViewModels
โ โโโ data/ # Data Layer
โ โ โโโ remote/ # Remote data
โ โ โ โโโ api/ # API interfaces
โ โ โ โโโ client/ # API clients
โ โ โโโ local/ # Local data
โ โ โ โโโ database/ # Database
โ โ โ โโโ dao/ # DAOs
โ โ โ โโโ entity/ # Entities
โ โ โโโ repository/ # Repositories
โ โโโ domain/ # Domain Layer
โ โ โโโ model/ # Business models
โ โ โโโ response/ # API response models
โ โโโ core/ # Core utilities
โ โโโ constant/ # Constants
โ โโโ util/ # Utilities
โ โโโ extension/ # Extension functions
โ โโโ config/ # Configuration
โ โโโ interfaze/ # Interface definitions
โโโ res/ # Resource files
โโโ assets/ # Static assets
โโโ ic_qweather/ # Weather icons
- Follow Kotlin official coding conventions
- Use KDoc for documentation comments
- Follow MVVM architecture layering principles
- Compose UI components use functional programming style
feat: New feature
fix: Bug fix
docs: Documentation update
style: Code formatting
refactor: Code refactoring
test: Testing
chore: Build/tooling
./gradlew test./gradlew connectedAndroidTestThis project is licensed under the GNU General Public License v3.0.
Copyright (C) 2024 ๅ้่ฟ (Lv Jujin)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Lv Jujin (ๅ้่ฟ)
- GitHub: @LvJujin
- Gitee: @ljj2987145363
Issues and Pull Requests are welcome!
- Fork this repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'feat: Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
If you have any questions or suggestions, feel free to contact us through:
- Submit an Issue: GitHub Issues
- Project Homepage: https://github.com/LvJujin/WeaKnow
- QWeather - Weather data API provider
- Amap - Positioning and geocoding services
- Material Design - UI design specification
- Jetpack Compose - Modern UI toolkit
โญ If this project helps you, please give it a star! โญ
Made with โค๏ธ by Lv Jujin