A modern Android weather application built with Jetpack Compose, featuring real-time weather data, location-based forecasts, and a home screen widget.
This weather app provides comprehensive weather information including current conditions, hourly and daily forecasts, weather alerts, and air quality data. It uses the OpenWeatherMap API to fetch weather data and supports multiple units and languages.
- Android Studio (latest version recommended)
- Android SDK (API level 26+)
- OpenWeatherMap API key (Get one here)
-
Clone the repository:
git clone https://github.com/lkw1120/compose-weatherapp.git cd compose-weatherapp -
Create
local.propertiesfile in the root directory:sdk.dir=/path/to/your/android/sdk OPEN_WEATHER_API_KEY=your_api_key_here
-
Open the project in Android Studio and sync Gradle files.
-
Run the app on an emulator or physical device.
Note: The local.properties file is already in .gitignore and will not be committed to the repository.
The app follows Clean Architecture principles with a modular structure:
-
Core Modules
core: Common utilities, network monitoring, location servicescore-domain: Domain models and use cases (business logic)core-data: Data layer with repositories, API clients, and local databasecore-ui: Shared UI components and mappers
-
Feature Modules
feature-main: Main weather screen with current conditions and forecastsfeature-search: Location search functionalityfeature-bookmarks: Favorite locations managementfeature-settings: App settings and preferencesfeature-weather-preview: Weather preview bottom sheetfeature-widget: Home screen widget
-
Navigation Module
navigation: App-wide navigation setup
The architecture follows MVVM pattern with:
- ViewModels: UI state management and coordination with use cases
- UI Layer: Jetpack Compose screens and components
- Repository Pattern: Data abstraction layer
- Use Cases: Single responsibility business operations
- Jetpack Compose - Modern declarative UI toolkit
- Material 3 - Material Design components
- Navigation Compose - Type-safe navigation
- Lucide Icons - Icon library for UI components
- Hilt - Dependency injection framework
- Retrofit - HTTP client
- Moshi - JSON parsing
- OkHttp - HTTP client with logging interceptor
- Room - Local database for caching weather data
- DataStore - Key-value storage for settings
- Work Manager - Background tasks for widget updates
- Glance - App widget framework
- Timber - Logging utility
- TedPermission - Permission handling
- Android Studio - Primary IDE for Android development
- Cursor - AI-powered code editor (used with assistance during development)
- Current Weather: Real-time weather conditions for current location
- Location Search: Search and add multiple locations
- Favorites: Save and manage favorite locations
- Forecasts: Hourly (24 hours) and daily (8 days) weather forecasts
- Weather Alerts: Severe weather warnings and advisories
- Air Quality: Air pollution index (PM2.5)
- Weather Widget: Home screen widget with current weather
- Settings: Customizable units (temperature, wind speed, precipitation, etc.) and time format
- Multi-language: Supports multiple languages via OpenWeatherMap API
Contributions are welcome! Feel free to submit issues and pull requests.
Copyright 2025 lkw1120
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.