An open API service indexing awesome lists of open source software.

https://github.com/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.
https://github.com/yassineabou/weather

android android-architecture-components baseline-profiles data-binding datastore google-play-services hilt kotlin kotlin-coroutines kpermissions moshi mvvm retrofit2 room sdp secrets-gradle-plugin stateflow viewmodel viewpager2 weather

Last synced: 7 months ago
JSON representation

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.

Awesome Lists containing this project

README

          


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
This project uses the [Open-Meteo](https://open-meteo.com/) API to fetch weather data.

## Architecture
The architecture of this application relies and complies with the following points below:
* A single-activity architecture, using the [ViewPager2](https://developer.android.com/develop/ui/views/animations/screen-slide-2) to display a collection of fragments in a scrollable, swipeable interface.
* Pattern [Model-View-ViewModel](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel)(MVVM) which facilitates a separation of development of the graphical user interface.
* [Android architecture components](https://developer.android.com/topic/libraries/architecture/) 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 🧰

- [Baseline Profiles](https://developer.android.com/topic/performance/baselineprofiles/overview) (Performance optimization tool)
- [ViewPager2](https://developer.android.com/develop/ui/views/animations/screen-slide-2) (Swipeable pager)
- [Dots Indicator](https://github.com/tommybuonomo/dotsindicator) (Material view pager dots indicator)
- [Data Binding](https://developer.android.com/topic/libraries/data-binding) (Bind views)
- [StateFlow](https://developer.android.com/kotlin/flow/stateflow-and-sharedflow) (State observable)
- [ViewModel](https://developer.android.com/topic/libraries/architecture/viewmodel) (Store and manage UI-related data)
- [Kotlin Coroutine](https://developer.android.com/kotlin/coroutines) (Light-weight threads)
- [Google Play services](https://developers.google.com/android/guides/setup) (Google service integration)
- [Moshi](https://github.com/square/moshi) (JSON serialization)
- [Hilt](https://dagger.dev/hilt/) (Dependency injection for android)
- [Retrofit2](https://github.com/square/retrofit) (HTTP client for APIs)
- [Room](https://developer.android.com/topic/libraries/architecture/room) (Abstraction layer over SQLite)
- [Sdp](https://github.com/intuit/sdp) (Scalable size unit)
- [DataStore](https://developer.android.com/topic/libraries/architecture/datastore) (Key-value storage)
- [Ssp](https://github.com/intuit/ssp) (Scalable size unit for texts)
- [Kpermissions](https://github.com/fondesa/kpermissions) (Coroutines based runtime permissions)

## 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.