SShortSingh.
Back to feed

Developer Builds Battery-Friendly Geofencing App to Auto-Silence Phone in Quiet Zones

0
·1 views

A developer created an Android app called Muffle after repeatedly forgetting to silence his phone in quiet public spaces, including during prayer. The app uses Android's GeofencingClient to automatically adjust audio profiles when a user enters a defined location, such as a library or place of worship. Building it required a dual-layer architecture: coarse geofence triggers from Google Play Services combined with secondary validation to filter out false or premature alerts. A key challenge was balancing location precision with battery efficiency, as continuous GPS polling drains power rapidly while low-accuracy methods often miss geofence boundaries entirely. The developer also had to handle edge cases like device reboots, using the BOOT_COMPLETED broadcast to re-register geofence triggers after a power cycle.

Read the full story at DEV Community

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

Related stories

0
ProgrammingDEV Community ·

Checker: A Zero-Dependency Go Library for Declarative Struct Validation

A Go library called Checker has been released to simplify input validation by replacing verbose if-statement chains with struct tag declarations. Developers can define rules such as required fields, email format checks, minimum password length, and cross-field comparisons directly alongside struct fields. Unlike many validation libraries, Checker also includes normalizers — such as trim, title-case, and HTML escaping — that run in the same pipeline as validation rules. The library has no external dependencies beyond the Go standard library, reducing supply-chain risk and keeping build times lean. It also supports nested structs, container-level rules for slices and maps, conditional field requirements, and 23 built-in translated locales for error messages.

0
ProgrammingDEV Community ·

Google Named Its AI Gemini After Twin Gods — Here Is the Mythology Behind It

Google's AI model family, Gemini, is officially named to represent the merger of DeepMind and Google Brain, but the name also draws from the Greek myth of the twin demigods Castor and Pollux. In the myth, mortal Castor and immortal Pollux were granted a compromise by Zeus, alternating between the underworld and Mount Olympus rather than being separated by death. Some observers draw a parallel between this divine alternation and the turn-based structure of large language model conversations, where a human user and an AI model exchange prompts and responses. The analogy positions the human as the mortal Castor and the AI as the divine Pollux, with each exchange representing a temporary transfer of capability across that boundary. Whether symbolic or coincidental, the Gemini name connects a modern AI product to one of antiquity's most enduring stories about mortality, divinity, and shared existence.

0
ProgrammingDEV Community ·

Three Common STM32 Timer Mistakes That Cause Incorrect PWM Output

Developers working with STM32 microcontrollers often encounter incorrect PWM frequencies despite seemingly correct PSC and ARR register values. A key source of error is off-by-one miscalculations, since both PSC and ARR are zero-based registers, meaning PSC=71 acts as a divide-by-72 prescaler. Another frequent mistake involves using the CPU or APB peripheral clock instead of the actual effective timer input clock, which varies by device family and clock tree configuration. Additionally, choosing PSC and ARR values without considering counter resolution can affect duty-cycle precision, as a larger ARR provides more discrete compare values. The correct formula for edge-aligned PWM frequency is timerClock divided by the product of (PSC+1) and (ARR+1), and consulting the specific MCU reference manual remains essential for accurate results.

0
ProgrammingDEV Community ·

AI Industry in 2026: Smaller Models, Cheaper Inference, and NVIDIA's $3.5T Rise

By late 2026, NVIDIA became the first tech company to surpass a $3.5 trillion market cap, overtaking Apple and Microsoft, reflecting the scale of AI's industrial transformation. Foundation models are now grouped into three competitive tiers — closed frontier leaders, open-source challengers, and specialized reasoning models — with the gap between them narrowing. A key shift in 2026 is that small models under 7 billion parameters can now match roughly 90% of GPT-4's performance on specific tasks at a fraction of the cost, redefining 'capability density' as the new benchmark. Post-training data quality has emerged as more impactful than raw data volume, while multimodal models have moved from experimental demos into production use across medicine, science, and coding. On the infrastructure side, NVIDIA retains dominance largely due to its deeply entrenched CUDA software ecosystem, even as AMD, Google, and Chinese chipmakers offer competitive hardware alternatives.

Developer Builds Battery-Friendly Geofencing App to Auto-Silence Phone in Quiet Zones · ShortSingh