A modern, feature-rich Android weather application built with Jetpack Compose, offering comprehensive weather information through both an intuitive mobile app and customizable home screen widgets.
- Real-time Weather Data: Current conditions, hourly forecasts, and 10-day forecasts
- Multiple Location Support: Add and manage multiple locations with swipe navigation
- Location Services: Automatic current location detection with GPS integration
- Modern UI: Built with Jetpack Compose and Material Design 3
- Dark/Light Theme: Automatic theme switching based on system preferences
- Offline Support: Local caching with Room database for offline access
- Pull-to-Refresh: Intuitive refresh mechanism for updated weather data
- 4x1 Compact Widget: Essential weather info in minimal space
- 4x2 Detailed Widget: Current weather with hourly forecast
- 5x1 Extended Widget: Current conditions with 3-hour forecast timeline
- 5x2 Comprehensive Widget: Full weather overview with 6-hour forecast and daily summary
- Current temperature and "feels like" temperature
- Weather conditions with descriptive icons
- High/low temperatures for the day
- Humidity, wind speed, and visibility
- UV index and atmospheric pressure
- Sunrise and sunset times
- Hourly forecasts with temperature trends
- 10-day extended forecast
SkyPeek follows Clean Architecture principles with MVVM pattern, ensuring maintainable, testable, and scalable code.
βββββββββββββββββββββββββββββββββββββββ
β Presentation Layer β
β βββββββββββββββ ββββββββββββββββββββ
β β Compose β β ViewModels ββ
β β UI β β ββ
β βββββββββββββββ ββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββ
β Domain Layer β
β βββββββββββββββ ββββββββββββββββββββ
β β Use Cases β β Repositories ββ
β β β β (Interfaces) ββ
β βββββββββββββββ ββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββ
β Data Layer β
β βββββββββββββββ ββββββββββββββββββββ
β β Remote β β Local ββ
β β Data Source β β Data Source ββ
β β (APIs) β β (Database) ββ
β βββββββββββββββ ββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββ
- MainActivity: Main entry point with navigation and permission handling
- ViewModels: State management with reactive data flows
- Compose UI: Modern declarative UI components
- Widgets: Home screen widget providers and services
- Models: Core business entities (
WeatherData
,LocationData
) - Repository Interfaces: Contracts for data access
- Use Cases: Business logic encapsulation
- Remote: API services and DTOs for weather data
- Local: Room database for caching and offline support
- Repository Implementations: Data source coordination
- Kotlin: 100% Kotlin codebase
- Jetpack Compose: Modern declarative UI toolkit
- Material Design 3: Latest Material Design components
- Coroutines: Asynchronous programming and reactive streams
- Hilt: Dependency injection framework
- Room: Local database for caching
- DataStore: Preferences and settings storage
- WorkManager: Background task scheduling
- Navigation Compose: Type-safe navigation
- Retrofit: HTTP client for API communication
- OkHttp: Network layer with logging and caching
- Gson: JSON serialization/deserialization
- Google Play Services: Location and geocoding services
- FusedLocationProviderClient: Efficient location updates
- JUnit: Unit testing framework
- Mockito: Mocking framework for tests
- Coroutines Test: Testing coroutines and flows
- Compose Test: UI testing for Compose components
SkyPeek uses multiple weather APIs for reliability and comprehensive data:
- Free: No API key required
- Comprehensive: Current, hourly, and daily forecasts
- Reliable: High uptime and accuracy
- Features: Temperature, weather codes, wind, humidity, pressure
- Free Tier: 1M calls/month
- Rich Data: Air quality, alerts, astronomy data
- Global Coverage: Worldwide weather information
- Free Tier: 1K calls/day
- Established: Reliable fallback service
- Standard: Industry-standard weather data
- Android Studio Arctic Fox or later
- Android SDK 26+ (Android 8.0)
- Kotlin 1.8+
-
Clone the Repository
git clone https://github.com/sandeepkv93/skypeek.git cd skypeek
-
Configure API Keys (Optional)
Create or edit
local.properties
file:# WeatherAPI.com (Optional - 1M calls/month free) WEATHER_API_KEY=your_weatherapi_key_here # OpenWeatherMap (Optional - 1K calls/day free) OPENWEATHER_API_KEY=your_openweather_key_here
Note: The app works without API keys using the free Open-Meteo service.
-
Build and Run
./gradlew assembleDebug
-
Install on Device
./gradlew installDebug
- Visit WeatherAPI.com
- Sign up for a free account
- Get your API key from the dashboard
- Add to
local.properties
:WEATHER_API_KEY=your_key_here
- Visit OpenWeatherMap
- Sign up for a free account
- Get your API key from the dashboard
- Add to
local.properties
:OPENWEATHER_API_KEY=your_key_here
- Material Design 3: Latest design system with dynamic theming
- Accessibility: Full accessibility support with content descriptions
- Responsive: Adaptive layouts for different screen sizes
- Intuitive: User-friendly navigation and interactions
- Weather Cards: Clean, informative weather displays
- Horizontal Pager: Smooth navigation between locations
- Bottom Sheets: Contextual actions and settings
- Pull-to-Refresh: Intuitive data refresh mechanism
- Loading States: Smooth loading animations and skeleton screens
- Adaptive Backgrounds: Dynamic backgrounds based on weather conditions
- Readable Typography: High contrast text for outdoor visibility
- Touch Targets: Appropriately sized interactive elements
- Information Hierarchy: Clear visual hierarchy for quick scanning
- Debug: Development build with debugging enabled
- Release: Production build with ProGuard optimization
<!-- Essential Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Location Permissions -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- Widget Permissions -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
The app includes optimized ProGuard rules for release builds:
- Code obfuscation and minification
- Resource shrinking
- Unused code elimination
src/
βββ test/ # Unit tests
β βββ domain/ # Domain layer tests
β βββ data/ # Data layer tests
β βββ presentation/ # ViewModel tests
βββ androidTest/ # Integration tests
βββ ui/ # UI tests
βββ database/ # Database tests
# Unit tests
./gradlew test
# Instrumented tests
./gradlew connectedAndroidTest
# All tests
./gradlew check
- Unit Tests: ViewModels, repositories, use cases
- Integration Tests: Database operations, API calls
- UI Tests: Compose components and user interactions
- Efficient Image Loading: Coil for optimized image caching
- Database Optimization: Room with efficient queries
- Memory Leaks: Proper lifecycle management and coroutine scoping
- Caching: HTTP caching with OkHttp
- Request Deduplication: Avoiding duplicate API calls
- Offline Support: Local data persistence
- Background Tasks: Efficient WorkManager scheduling
- Location Updates: Optimized location request intervals
- Widget Updates: Smart update frequency based on user interaction
- Size: 4 cells wide Γ 1 cell tall
- Content: City name, temperature, weather icon, condition
- Use Case: Minimal space, essential information
- Size: 4 cells wide Γ 2 cells tall
- Content: Current weather + 3-hour forecast
- Features: High/low temperatures, detailed conditions
- Size: 5 cells wide Γ 1 cell tall
- Content: Current weather + hourly timeline
- Features: 3-hour forecast with temperature trend
- Size: 5 cells wide Γ 2 cells tall
- Content: Full weather overview
- Features: 6-hour forecast, tomorrow's weather, sunrise/sunset
- Auto-refresh: Configurable update intervals
- Location Sync: Automatic location updates
- Interactive Elements: Tap to open app or refresh
- Dynamic Backgrounds: Weather-appropriate themes
- Error Handling: Graceful error states and retry mechanisms
- Location Data: Used only for weather services, not stored permanently
- API Keys: Securely stored in build configuration
- User Data: Minimal data collection, no personal information tracking
- HTTPS Only: All network communication encrypted
- Certificate Pinning: Enhanced security for API communications
- Input Validation: Proper validation of user inputs and API responses
- String Resources: Externalized strings for easy translation
- RTL Support: Right-to-left language support
- Date/Time Formatting: Locale-appropriate formatting
- Temperature Units: Celsius/Fahrenheit based on locale
- Create new
values-{language}/strings.xml
- Translate all string resources
- Test with different locales
- Update documentation
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Follow the coding standards and architecture patterns
- Write tests for new functionality
- Submit a pull request
- Kotlin Style Guide: Follow official Kotlin conventions
- Architecture: Maintain clean architecture principles
- Documentation: Document public APIs and complex logic
- Testing: Write tests for new features and bug fixes
- All changes require code review
- Automated tests must pass
- Follow the established architecture patterns
- Maintain backward compatibility
- Open-Meteo: Free weather API service
- Material Design: Google's design system
- Jetpack Compose: Modern Android UI toolkit
- Weather Icons: Custom weather icon designs
- Community: Open source contributors and testers
SkyPeek - Your window to the sky π€οΈ