yassineAbou / Weather

This android app provides weather info for multiple cities, including current, 48h, and 8d forecasts. It can also detect user's location for accurate local weather.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weather

Weather

Kotlin version 1.8.21 Gradle version 8.0.2 Android Studio Flamingo Android min version 7

Users can view and add weather information for multiple cities of their choice with this app.
It provides a 48-hour forecast, an 8-day forecast, and current weather conditions.
The program can also detect the user’s location to provide accurate local weather information.

Get it on Google Play

Screenshots

API Key πŸ”‘

The project has an API key included. To use a different API key, follow these steps:

  1. Visit the OpenWeatherMap website.
  2. If you don't already have an account, register for one.
  3. Make sure you use One Call API 2.5. It is free to use for up to 1,000 API calls per day.
  4. Once you have an account, request an API key.
  5. Open WeatherApiService.kt.
  6. In the WEATHER_API_KEY property, paste your API key.

Architecture

The architecture of this application relies and complies with the following points below:

  • A single-activity architecture, using the ViewPager2 to display a collection of fragments in a scrollable, swipeable interface.
  • Pattern Model-View-ViewModel(MVVM) which facilitates a separation of development of the graphical user interface.
  • Android architecture components which help to keep the application robust, testable, and maintainable.

Package Structure

com.yassineabou.weather        # Root package  
β”œβ”€β”€ data                   # For data modeling layer  
β”‚   β”œβ”€β”€ local              # Local persistence database  
|   β”œβ”€β”€ model              # Model classes  
β”‚   β”œβ”€β”€ remote             # Remote data source  
β”‚   └── repository         # Repositories for single source of data  
|  
β”œβ”€β”€ di                     # Dependency injection modules  
β”‚  
β”œβ”€β”€ ui                     # Activity / Fragment / ViewModel  
β”‚   β”œβ”€β”€ addLocation        # Allows user to add new locations
β”‚   β”œβ”€β”€ currentWeather     # Presents current weather details
|   β”œβ”€β”€ dailyForecast      # Showcases daily weather forecast
|   β”œβ”€β”€ hourlyForecast     # Illustrates hourly weather forecast  
|   β”œβ”€β”€ listLocations      # Lists saved locations
|   β”œβ”€β”€ PagerAdapter       # Adapter for viewPager2  
|   β”œβ”€β”€ MainActivity       # Single activity  
β”‚   └── MainViewModel      # Shared viewModel  
|  
β”œβ”€β”€ utils                  # Utility classes / Kotlin extensions  
└── WeatherApplication     # Application  
  

Built With 🧰

Contribution

We welcome contributions to our project! Please follow these guidelines when submitting changes:

  • Report bugs and feature requests by creating an issue on our GitHub repository.
  • Contribute code changes by forking the repository and creating a new branch.
  • Ensure your code follows our coding conventions.
  • Improve our documentation by submitting changes as a pull request.

Thank you for your interest in contributing to our project!

License

Copyright 2023 Yassine Abou 
  
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.

About

This android app provides weather info for multiple cities, including current, 48h, and 8d forecasts. It can also detect user's location for accurate local weather.

License:Apache License 2.0


Languages

Language:Kotlin 100.0%