Mobile App for Weather Monitoring
Weather apps are deceptively simple: take API, show temperature and icon. But in production, questions arise: which data provider is more accurate for specific region, how to make a rain map that doesn't lag on weak devices, how widgets on screen update without constant battery drain, and how alert about hail comes 10 minutes ahead, not after the fact.
Weather Data Sources
Provider choice determines accuracy, especially outside major cities.
| Provider | Forecast | Update | Features |
|---|---|---|---|
| Open-Meteo | 16 days | 1h | Free, open-source, good Europe/CIS |
| OpenWeatherMap | 8 days | 3h | Wide coverage, alerts |
| Tomorrow.io | 15 days | 1h | Minutecast, hyperlocal |
| Meteoblue | 7 days | 3h | Mesoscale models, mountains |
| Yandex Weather API | 7 days | 1h | More accurate for RF/CIS |
For max accuracy — aggregate multiple sources with historical weight averaging per location. For most projects — one provider sufficient.
On mobile, weather data cached locally — CoreData/Room for structured weather data. Cache TTL: current conditions — 10 minutes, hourly forecast — 1 hour, 14-day — 6 hours.
Rain Map
Most resource-intensive part. Rain radar tiles (radar tiles) — WMS or XYZ tiles, updated every 5-10 minutes.
iOS: MapKit with MKTileOverlay — custom class loading tiles by URL template https://tiles.provider.com/radar/{z}/{x}/{y}/{timestamp}.png. Animation — loop through timestamps array with CADisplayLink or Timer to switch overlays.
Android: Mapbox or Google Maps with TileOverlay. For animation — change TileProvider source each frame with fade transition.
Performance issue: loading tiles one per animation frame — flickering. Right way: preload all frames in background queue before animation start, keep in memory NSCache/LruCache, run animation on ready. Preload limit: 6-10 frames × 9 visible tiles = ~100 tiles, ~5-10 MB memory.
Home Screen Widget
iOS: WidgetKit with TimelineProvider. Entry every 15-30 minutes (system regulated). Widget can't make network requests directly — TimelineProvider requests data in getTimeline(in:completion:), forms TimelineEntry array for next hours. TimelineReloadPolicy.atEnd — reload when timeline ends.
SwiftUI view for widget doesn't support gestures except Link. Three sizes: .systemSmall, .systemMedium, .systemLarge — each has own layout.
Android: Glance (Jetpack) — Compose-like API for App Widgets. Update via GlanceAppWidgetManager + WorkManager scheduled task.
Data between main app and widget: iOS — App Groups + UserDefaults(suiteName:). Android — SharedPreferences with provider.
Dangerous Phenomena Alerts
Push notifications about hail, storm, icing — via server scheduler. Every N minutes check weather alerts from provider for all subscribed user coordinates → if new alert → FCM/APNs. Priority: high for critical phenomena (APNs apns-priority: 10, FCM priority: high).
For immediate alerts (tornado, emergency signals) — UNNotificationContent with interruptionLevel: .critical (iOS 15+): passes through "Do Not Disturb".
Geofencing for "I care about weather in current location": CLLocationManager.startMonitoringSignificantLocationChanges() — alert on ~500m shift, no constant GPS drain.
Timeline
Basic weather app (current conditions, 7-day forecast, widget) — 2-4 weeks. With rain map, extreme phenomena alerts, and multiple locations — 6-8 weeks. Cost calculated individually.







