A modern, visually appealing Android Weather Application developed in Kotlin using Jetpack Compose. It provides precise current weather conditions and hourly forecasts by fetching real-time data based on the user's location.
The project is structured with Clean Architecture principles and implements the MVVM (Model-View-ViewModel) pattern to ensure scalability, maintainability, and testing capabilities.
- Current Weather: Displays accurate current weather, including temperature, weather conditions, humidity, pressure, and wind speed.
- Hourly Forecast: See the weather trends and temperatures for the rest of the day.
- Location-based Tracking: Automatically fetches weather data based on the device's current location using the Fused Location Provider.
- Search Capabilities: Find the weather for different locations using the built-in search bar.
- Modern UI: Fully built with Jetpack Compose matching a clean and dynamic UI/UX design.
- Language: Kotlin
- UI Toolkit: Jetpack Compose for a declarative UI.
- Architecture: Clean Architecture (Data, Domain, Presentation layers) combined with MVVM.
- Dependency Injection: Dagger Hilt for robust DI.
- Networking: Retrofit 2 for REST API calls.
- JSON Serialization & Parsing: Moshi.
- Asynchronous Operations: Kotlin Coroutines for background tasks and asynchronous flows.
- Location Services: Google Play Services (Fused Location Provider) logic to get accurate coordinates continuously.
- Weather API: Open-Meteo, a high-performance open-source weather API (requires no API key).
The app follows Clean Architecture principles allowing changes to be independent of each other:
- Presentation Layer: Contains the UI (
MainActivityand Composable components likeWeatherCard,HourlyWeatherDisplay,Search_Bar) and theWeatherViewModelreacting to state changes (WeatherState). - Domain Layer: Holds standard business logic and models. Uses repository interfaces enabling decoupling.
- Data Layer: Contains actual implementations of repositories, DTOs (
WeatherDto,WeatherDataDto), and network interactions (WeatherAPI). - DI Core: Dedicated DI package configuring singletons and scoped instances (e.g., Repositories, APIs) using Dagger Hilt.
- Android Studio Koala (or newer) supporting Compose.
- Android device or Emulator running Android API Level 27+.
- Clone the repository:
git clone https://github.com/Tarun-sharma05/Weather-Now.git
- Open the project in Android Studio.
- Build the project and let Gradle sync all dependencies.
- Make sure location services are enabled on your test device for the functionality to work.
- Hit "Run".
- Provided by the open source Weather data from Open-Meteo API.