Urgent.News

What's breaking now, across thousands of outlets.

Tech

Architecting a Foreground Service That Persists Across Android’s Aggressive Process Killing

It was the middle of a Friday afternoon prayer session at the local mosque. The room was silent, filled with the hum of shared focus, until a high-pitched notification ping tore through the sanctity of the moment. It was my phone. I had carefully silenced it before entering, but a mid-day system update had reset my custom volume profiles, and in my rush, I had simply forgotten to check. The look…

A high-pitched notification disrupted a mosque prayer session, embarrassing the reporter who had forgotten to silence his phone. This experience led to the creation of Muffle, an app designed to manage sound states based on triggers like GPS, time, and prayer schedules. The challenge wasn't just forgetting to adjust settings but the cognitive load of manually toggling the ringer when crossing thresholds.

Many existing solutions either triggered inaccurately or were killed by Android's process management. Foreground services could keep the app alive, but manufacturers often have aggressive battery management layers that further complicate background execution. The reporter found WorkManager useful for periodic tasks but still needed a Foreground Service to handle critical monitoring logic.

He also had to handle the ACTION_BOOT_COMPLETED broadcast receiver to survive phone restarts. The reporter implemented a notification with clear value and adjusted GPS polling frequency based on distance to reduce power consumption. He also considered using Geofencing instead of manual location polling for better performance and faced challenges with Do Not Disturb permissions across different Android versions.

Ultimately, Muffle's architecture assumes the service may die and stores state in a local database for quick restart. The key takeaway is treating Android OS as an adversary and building for failure by making background tasks as lightweight as possible.

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

Oracle Manipulation Risk Report: Aave V3

Oracle Manipulation Risk Report: Aave V3 Target Protocol : Aave V3 (TVL: $18034.0M) Oracle Manipulation Risk Report – Aave V3 Protocol: Aave V3 (Ethereum + L2s) – TVL: ≈ $18.0 B (Oct 2026) Prepared…

  • Six attack vectors identified for Aave V3 price manipulation
  • Risk rated moderate-high (7/10) by senior DeFi researchers
  • Recommendations to reduce risks to 3/10 or lower

Meta wants your next gadget to be Muse-infused

Meta wants Muse in your TV and your toaster, so it's giving the code away for free.

  • Meta unveils Muse Gadgets, open-source project for AI agent integration.
  • Provides open-source firmware, Linux SDK, and project ideas.
  • Muse Home Link connects to home networks and smart devices.

How I Think and Solve Count Ways to Distribute Candies in Elixir

Como Penso e Resolvo "Count Ways to Distribute Candies" em Elixir Um Guia Completo da Força Bruta aos Números de Stirling Na sequência do artigo anterior sobre Distribute Candies Among Children II…

  • Distributing unique candies into non-empty bags based on Stirling numbers of the second kind
  • Recurrence of Stirling numbers used for efficient calculation via dynamic programming
  • Exploring Stirling numbers to determine ways to distribute candies

Your Python Tests Passed. Your Published Wheel Is Missing Files.

In July 2026, MLX shipped v0.32.0 for macOS ARM64. The wheel contained py.typed . It did not contain a single .pyi stub — every stub the previous release had was silently gone.

  • MLX Python package version 0.32.0 released in July 2026
  • Missing .pyi stub files caused type checking to break
  • wheeltruth tool developed to verify wheel distributions

More from Saturday 3 October →