Developer Builds Offline Android App to Auto-Silence Phone Using Custom Geofencing
A developer created a fully offline Android app that automatically silences a phone when entering defined locations, inspired by an embarrassing notification interruption at a wedding. Instead of using Google Play Services' GeofencingClient, the app relies on Android's native LocationManager API and a ForegroundService to calculate proximity using the Haversine formula. The solution stores all logic on-device, requiring no internet connection or third-party cloud data sharing, making it functional even in areas with no signal. A BroadcastReceiver listening for device reboots ensures the monitoring service restarts automatically. To counter GPS drift on budget hardware causing erratic toggling, the developer added a hysteresis buffer requiring sustained presence inside or outside a boundary before changing the phone's sound profile.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in