# creatiwww/androidappmarsweather architecture

> Architecture diagram of the GitHub repository creatiwww/androidappmarsweather, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/creatiwww/androidappmarsweather
- Repository: https://github.com/creatiwww/androidappmarsweather

## Overview

Mars Weather is an Android app that displays the latest Mars weather report, Mars sol and time, in both an activity and a home-screen widget. The main refresh flow starts at either UI, is deduplicated by ServiceHelper, and runs through GetService and Processor: Processor fetches the latest report, compares its date with persisted data, and inserts new values when needed. The activity observes provider data; the widget refreshes from it after provider-change broadcasts. The source excerpts support these principal paths, but do not show every Android manifest or runtime registration detail.

Main entry points: [`app/src/main/java/com/fourbeams/marsweather/domain/Processor.java`](https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/Processor.java) (Weather processor), [`app/src/main/java/com/fourbeams/marsweather/presentation/MainActivity.java`](https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/presentation/MainActivity.java) (Weather activity), [`app/src/main/java/com/fourbeams/marsweather/domain/MyWidgetProvider.java`](https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/MyWidgetProvider.java) (Home widget), [`app/src/main/java/com/fourbeams/marsweather/persistence/MarsWeatherContentProvider.java`](https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/persistence/MarsWeatherContentProvider.java) (Weather content provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["App presentation"]
  node_activity["Weather activity<br/>[MainActivity.java]"]
  node_widget["Home widget"]
end

subgraph group_refresh["Refresh and domain"]
  node_dateutil["Mars time conversion"]
  node_helper["Service helper<br/>[ServiceHelper.java]"]
  node_getservice["Background service<br/>[GetService.java]"]
  node_processor["Weather processor<br/>[Processor.java]"]
end

subgraph group_remote["Weather API"]
  node_api{{"Mars weather API"}}
  node_generator["REST client setup"]
  node_service["Weather endpoint"]
  node_report["Report model<br/>[POJO.java]"]
end

subgraph group_storage["Local weather data"]
  node_provider[("Weather content provider")]
end

node_user(("User"))

node_user -->|"opens"| node_activity
node_activity -->|"requests refresh"| node_helper
node_widget -->|"requests refresh"| node_helper
node_helper -->|"starts service"| node_getservice
node_getservice -->|"dispatches task"| node_processor
node_processor -->|"creates client"| node_generator
node_processor -->|"requests report"| node_service
node_generator -->|"configures endpoint"| node_api
node_service -->|"returns report"| node_report
node_processor -->|"reads fields"| node_report
node_processor -->|"checks and inserts"| node_provider
node_activity -->|"queries weather"| node_provider
node_provider -->|"notifies changes"| node_activity
node_provider -->|"broadcasts changes"| node_widget
node_widget -->|"loads latest data"| node_provider
node_activity -->|"converts Mars time"| node_dateutil
node_widget -->|"converts Mars time"| node_dateutil
node_processor -->|"broadcasts no change"| node_activity
node_processor -->|"broadcasts no change"| node_widget

click node_activity "https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/presentation/MainActivity.java"
click node_widget "https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/MyWidgetProvider.java"
click node_dateutil "https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/DateAndTimeUtil.java"
click node_helper "https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/ServiceHelper.java"
click node_getservice "https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/GetService.java"
click node_processor "https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/Processor.java"
click node_generator "https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/REST/RESTServiceGenerator.java"
click node_service "https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/REST/MarsWeatherService.java"
click node_report "https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/POJO.java"
click node_provider "https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/persistence/MarsWeatherContentProvider.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_activity,node_widget,node_user toneBlue
class node_dateutil,node_helper,node_getservice,node_processor toneAmber
class node_api,node_generator,node_service,node_report toneMint
class node_provider toneRose
```

## Components

### App presentation

- [Weather activity](https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/presentation/MainActivity.java): `app/src/main/java/com/fourbeams/marsweather/presentation/MainActivity.java`
- [Home widget](https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/MyWidgetProvider.java): `app/src/main/java/com/fourbeams/marsweather/domain/MyWidgetProvider.java`

### Refresh and domain

- [Mars time conversion](https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/DateAndTimeUtil.java): `app/src/main/java/com/fourbeams/marsweather/domain/DateAndTimeUtil.java`
- [Service helper](https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/ServiceHelper.java): `app/src/main/java/com/fourbeams/marsweather/domain/ServiceHelper.java`
- [Background service](https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/GetService.java): `app/src/main/java/com/fourbeams/marsweather/domain/GetService.java`
- [Weather processor](https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/Processor.java): `app/src/main/java/com/fourbeams/marsweather/domain/Processor.java`

### Weather API

- **Mars weather API**
- [REST client setup](https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/REST/RESTServiceGenerator.java): `app/src/main/java/com/fourbeams/marsweather/domain/REST/RESTServiceGenerator.java`
- [Weather endpoint](https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/REST/MarsWeatherService.java): `app/src/main/java/com/fourbeams/marsweather/domain/REST/MarsWeatherService.java`
- [Report model](https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/domain/POJO.java): `app/src/main/java/com/fourbeams/marsweather/domain/POJO.java`

### Local weather data

- [Weather content provider](https://github.com/creatiwww/androidappmarsweather/blob/master/app/src/main/java/com/fourbeams/marsweather/persistence/MarsWeatherContentProvider.java): `app/src/main/java/com/fourbeams/marsweather/persistence/MarsWeatherContentProvider.java`

### Other components

- **User**

## Connections

- User → Weather activity: opens
- Weather activity → Service helper: requests refresh (evidence: `app/src/main/java/com/fourbeams/marsweather/presentation/MainActivity.java`)
- Home widget → Service helper: requests refresh (evidence: `app/src/main/java/com/fourbeams/marsweather/domain/MyWidgetProvider.java`)
- Service helper → Background service: starts service (evidence: `app/src/main/java/com/fourbeams/marsweather/domain/ServiceHelper.java`)
- Background service → Weather processor: dispatches task (evidence: `app/src/main/java/com/fourbeams/marsweather/domain/GetService.java`)
- Weather processor → REST client setup: creates client (evidence: `app/src/main/java/com/fourbeams/marsweather/domain/Processor.java`)
- Weather processor → Weather endpoint: requests report (evidence: `app/src/main/java/com/fourbeams/marsweather/domain/Processor.java`)
- REST client setup → Mars weather API: configures endpoint (evidence: `app/src/main/java/com/fourbeams/marsweather/domain/REST/RESTServiceGenerator.java`)
- Weather endpoint → Report model: returns report (evidence: `app/src/main/java/com/fourbeams/marsweather/domain/REST/MarsWeatherService.java`)
- Weather processor → Report model: reads fields (evidence: `app/src/main/java/com/fourbeams/marsweather/domain/Processor.java`)
- Weather processor → Weather content provider: checks and inserts (evidence: `app/src/main/java/com/fourbeams/marsweather/domain/Processor.java`)
- Weather activity → Weather content provider: queries weather (evidence: `app/src/main/java/com/fourbeams/marsweather/presentation/MainActivity.java`)
- Weather content provider → Weather activity: notifies changes (evidence: `app/src/main/java/com/fourbeams/marsweather/persistence/MarsWeatherContentProvider.java`)
- Weather content provider → Home widget: broadcasts changes (evidence: `app/src/main/java/com/fourbeams/marsweather/persistence/MarsWeatherContentProvider.java`)
- Home widget → Weather content provider: loads latest data (evidence: `app/src/main/java/com/fourbeams/marsweather/domain/MyWidgetProvider.java`)
- Weather activity → Mars time conversion: converts Mars time (evidence: `app/src/main/java/com/fourbeams/marsweather/presentation/MainActivity.java`)
- Home widget → Mars time conversion: converts Mars time (evidence: `app/src/main/java/com/fourbeams/marsweather/domain/MyWidgetProvider.java`)
- Weather processor → Weather activity: broadcasts no change (evidence: `app/src/main/java/com/fourbeams/marsweather/domain/Processor.java`)
- Weather processor → Home widget: broadcasts no change (evidence: `app/src/main/java/com/fourbeams/marsweather/domain/Processor.java`)
