Urgent.News

650+ sources. One page. See who else covered it.

Editions

Tech

Architecting a Low-Power Geofencing Engine for Android Background Services

Opening hook It happened during a quiet Friday Jumu'ah prayer. The imam had just reached the most solemn part of the khutbah when a high-pitched, insistent ringtone echoed through the entire hall. Heads turned, whispers started, and the person responsible scrambled to silence their device, only to fumble and drop it in their haste. I sat there, mortified for them, knowing exactly how that sinking…

During a Friday Jumuah prayer, a high-pitched ringtone disrupted a sermon, causing people to scramble to silence their phones. This experience highlights the struggle many face in managing phone states in public spaces. Android offers AudioManager and NotificationManager for notification control, but they require manual input. The author tried alarm-based triggers, which lacked spatial awareness.

Most solutions rely on GPS polling, leading to excessive battery drain. The author sought a solution that operated in the background without draining battery life. They opted for the GeofencingClient within Google Play Services location APIs, as it is more battery-efficient. The implementation involved creating a GeofenceRequest and attaching a PendingIntent to a GeofenceBroadcastReceiver.

This design ensured the trigger remained active even if the app was killed, thanks to the ForegroundService architecture. However, GPS behavior in Doze mode on some Android devices posed challenges. The author also faced issues with WorkManager interfering with battery optimizations. They suggest adding a debug log system and implementing a fallback mechanism using proximity sensors or Wi-Fi SSIDs.

The main takeaway for developers is to work with Android's built-in APIs and manage edge cases effectively.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

I set the font to the largest size and found the same bug eleven times

I was cleaning up the UI on a side-project iOS app and did one thing: set Dynamic Type to XXXL and screenshot every screen. Reading the code had turned up nothing.

  • Reporter discovered eleven identical bugs in iOS app using largest Dynamic Type font size
  • Layout issue caused by parent view pinning side-by-side elements, problematic for Japanese text
  • Fix involved adjusting row layouts while preserving affordances like chevrons and toggles

Deprecation Doesn't Reach the Copies

Originally published on hexisteme notes . I keep my operating judgment in small, versioned files — one file per decision, each with a status, a list of what it supersedes, and a change history.

  • Deprecation rule failed to catch valuable insights
  • Rule initially aimed to filter responses with <70% consistency
  • New rule clarifies consistency score as diagnostic tool

More from Sunday 16 August →