Skip to content

Native Android home screen widget #32

@cnighswonger

Description

@cnighswonger

Summary

A native Android home screen widget that displays current weather conditions from a Kanfei station. Consumes data from either the REST API (#30) or the push export JSON (#29).

Depends on: #28 (JSON schema), and at least one of #29 (push) or #30 (REST)

Features

MVP

  • Home screen widget (resizable, minimum 2x1 cells)
  • Current temperature, humidity, wind speed/direction, conditions
  • Configurable data source URL (REST endpoint or static JSON URL)
  • Auto-refresh on configurable interval (default: 5 min)
  • Tap widget to open full detail view (in-app or browser to dashboard)

Nice to have

  • Multiple widget sizes (2x1 compact, 4x2 detailed, 4x4 full)
  • Multiple station support (one widget per station)
  • Wind direction compass graphic
  • Daily high/low
  • Rain accumulation
  • "Last updated" timestamp
  • Dark/light theme (follow system)
  • Offline indicator when data is stale

Data source

The widget should work with either:

  1. Push JSON URL — fetch a static JSON file from S3/R2/CDN (simplest, works behind NAT)
  2. REST API — fetch from /api/v1/current with API key header

Configuration in the widget setup screen:

  • Data URL (required)
  • API key (optional, for REST mode)
  • Station name / display label
  • Refresh interval

Technical considerations

  • Kotlin, Jetpack Glance (modern widget framework) or RemoteViews (broader compatibility)
  • Minimal permissions: INTERNET only
  • Battery-conscious: use WorkManager for background refresh, respect battery saver
  • Graceful degradation: show last known data + stale indicator when offline
  • Material You theming if using Glance

Repository

This should likely be a separate repo (kanfei-android or kanfei-widget) since it's a different build system (Gradle/Kotlin) and release cycle (Play Store).

Priority

Depends on the public data API (#28-#30) being available first. High user value — home screen weather widgets are one of the most common use cases for PWS data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions