Skip to content

Weather Application that can decorate your photo with the current weather condition.

Notifications You must be signed in to change notification settings

MohNage7/PhotoWeather

Repository files navigation

codebeat badge

PhotoWeather

Preview

Capture , Generate , Share. And check your history.

Project Overview

A Weather application based on openweathermap-api that let the users take a photo, add current weather information (e.g. place name, temperature, weather condition, …) as a banner overlay on top of the photo and finally, share it.

  • Capture new photo by built-in camera using camera2 API
  • Save photo locally
  • Detect current location
  • Request openweathermap-api to get current location weather data.
  • Set retrieved data in views and then convert all the ViewGroup to image.
  • Share the generated image accross applications.

App Architecture

The following diagram shows how all the modules will interact with one another.

Each component depends only on the component one level below it. For example, activities and fragments depend only on a view model. The repository is the only class that depends on multiple other classes; on a persistent data model and a remote backend data source.

NetworkBoundResource

A helper class that is used to take the decision of loading the data from the local db or from remote service.

The following diagram shows the decision tree for NetworkBoundResource:

NetworkBoundResource is using the local db as it's single source of truth.For example It starts by observing the database for Weather data. When the entry is loaded from the database for the first time, NetworkBoundResource checks whether the result is good enough to be dispatched or that it should be re-fetched from the network.

Libraries