Android Widgets

weNow provides four Android home screen widget types, built with react-native-android-widget. All widgets update automatically every 30 minutes to keep weather data current.

Widget Types

Widget Size Content
Small 2x2 Temperature, weather icon, and city name. A glanceable temperature check with day/night gradient background.
Large 4x2 Current weather with temperature, description, feels-like, humidity, and wind speed on the left. 3-day (or 3-hour) forecast on the right.
Detailed 4x3+ Full weather dashboard: centered icon and temperature hero, description, feels-like, confidence badge, humidity, wind, temperature range, and a 2-column 6-day (or 6-hour) forecast.
Overlay 4x3 Transparent glass widget designed to sit over the wallpaper. Displays time, city, temperature, description, 5-item forecast row, and humidity/wind footer.

Forecast Modes

The Large, Detailed, and Overlay widgets support two forecast display modes:

The forecast mode is configurable per widget through the widget configuration screen. The Small widget does not include a forecast section due to its compact 2x2 size.

Widget Configuration

When a user adds a widget to their home screen, the configuration screen appears with the following options:

Configuration is stored per widget in AsyncStorage, so each widget on the home screen can show a different city and forecast mode.

Data Flow

  1. The widget task handler receives a lifecycle event from Android (ADDED, UPDATE, RESIZED, or DELETED).
  2. For ADDED and UPDATE events, the handler reads the per-widget location from AsyncStorage.
  3. It fetches weather data from the backend's POST /api/weather/widget endpoint, which has a dedicated rate limit of 100 requests per day (separate from the main app's 5 requests per day).
  4. The response data is processed and passed to the appropriate widget component for rendering.
  5. The widget component returns a JSX tree that is serialized into an Android RemoteViews bitmap for display on the home screen.

Technical Details

Widget rendering in react-native-android-widget works fundamentally differently from normal React Native components:

Overlay Widget Specifics

The Overlay widget is designed to float transparently over the user's wallpaper, requiring special visual treatment:

Testing Limitations

Widgets cannot be tested in Expo Go because they depend on native Android widget infrastructure. To test widgets during development, you must create a native EAS build:

eas build --profile preview --platform android

Install the resulting APK on a physical device or emulator, then add the widget from the Android home screen's widget picker.