Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Architecting Low-Latency Geofencing for Automated Sound Profiles

It was the middle of a Friday afternoon prayer at the local mosque. The room was perfectly silent, filled with a few hundred people in deep focus. Suddenly, a high-pitched notification chime pierced the air, followed by the aggressive vibration of a phone hitting a wooden floor. The person sitting to my left scrambled to silence it, clearly mortified. We have all been that person, whether in a…

On a quiet Friday afternoon inside a mosque, a sudden high-pitched notification caused panic when a phone's vibration caused it to fall off a wooden surface. This is a common occurrence for many people in various settings, where an unexpected loud sound can disrupt the peace and professionalism. Most rely on their memory to manage their phone volume based on context, but this is often unreliable.

Existing solutions for managing phone volume in specific locations are often too cumbersome, either requiring constant manual adjustments or cloud-based dependencies that introduce privacy concerns and latency. The author sought an automatic, silent solution that would handle sound profiles in the background, without the user needing to constantly check or adjust their phone's settings.

To achieve this, the author turned to Android's GeofencingClient within the FusedLocationProviderClient suite, leveraging the power of GPS, Wi-Fi, and cellular tower signals. A persistent ForegroundService was implemented to ensure the monitoring process wasn't killed by Android's memory management. The GeofencingRequest was configured to trigger both when entering and exiting a defined location, with aggressive LoiteringDelay settings to ensure immediate responses.

A BroadcastReceiver was set up to handle GeofencingEvents and invoke the AudioManager for immediate changes in ringer mode. The architecture was modeled as a state machine, with location transitions acting as hooks for AudioManager modifications. A significant challenge was the inconsistency of GPS hardware across different devices, leading to a buffer zone UI adjustment for users in poor satellite reception areas.

The author also found that handling Do Not Disturb (DND) permissions required navigating complex manifest permissions, and that achieving the desired silent mode required a more restrictive DND policy. The author advises robustness in location-aware software, adding activity logs for debugging, and focusing on the user's mental model rather than the technical implementation.

Rewritten by urgent.news; may contain errors — check the original. How we use AI.

Source: dev.to

Read the original at dev.to →

More from Dev.to on urgent.news

Get the news by email. Yesterday's most-covered stories, every morning.

We track opens and clicks to improve the newsletter.

See today's edition · More options

More in Tech

Free test data for Italian e-invoices (FatturaPA), with 13 broken ones on purpose

A while ago I started looking at Italian electronic invoices (FatturaPA) and needed test files. It turned out to be harder than I expected. Real invoices are out.

  • Italian e-invoices (FatturaPA) contain sensitive data like names and tax codes
  • Researcher created generator with 36 valid, 13 broken invoices
  • Dataset available on Hugging Face, GitHub, and Apify for testing

A free, open-source Shopify currency converter app, and how it's built

Most Shopify currency converter apps do one thing: they swap every price on the storefront into the visitor's currency. That is useful, but Shopify Markets already does it for free.

  • Free, open-source Shopify app enables currency conversion and official rates display
  • AllRates-Today/allratestoday-shopify app available on GitHub under MIT license
  • Theme app extensions allow merchants to add blocks without modifying theme files

More from Sunday, 6 December 2026 →