SShortSingh.
Back to feed

How One Developer Built a Battery-Efficient App That Auto-Silences Your Phone by Location

0
·10 views

A developer created an Android app called Muffle to automatically switch phone sound profiles based on the user's physical location, addressing the common problem of forgotten manual silencing in places like mosques, clinics, and classrooms. The app uses Android's GeofencingClient, which offloads location monitoring to the system rather than keeping GPS running continuously, preserving battery life. When a geofence boundary is crossed, a BroadcastReceiver triggers a WorkManager task to apply the appropriate audio settings via AudioManager and the Do Not Disturb API. All routines are persisted in a local Room database so the correct sound profile can be restored even if the app process is killed by the system. The developer also built a priority-based queue to resolve conflicts when multiple triggers, such as a geofence and a calendar event, overlap simultaneously.

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 ·

Developer Demonstrates Sending Raw TPM 2.0 Commands via Windows TBS in Rust

A developer has published a technical walkthrough on using Windows TPM Base Services (TBS) to send raw TPM 2.0 commands directly through Rust code. The guide covers the full TPM2_GetRandom workflow, including creating a TBS context, marshalling the command, submitting it, and parsing the response to retrieve random bytes. TPM2_GetRandom was chosen as the example because it requires no session and has minimal parameters, making it one of the simpler TPM commands to implement. The tutorial relies on the windows-sys crate and highlights key details such as big-endian byte encoding for TPM command headers. Notably, the TPM may return fewer random bytes than requested if it cannot generate the full amount in a single operation.

0
ProgrammingDEV Community ·

Flutter 'LEGO Architecture': Writing Modular, Reusable Code Like Interlocking Bricks

Developer Atuoha Anthony published a detailed guide on freeCodeCamp on September 11, 2026, explaining how to structure Flutter code using a concept called LEGO Architecture. The approach treats each widget, class, or service as a LEGO brick with a single responsibility and a standardized interface — called a 'stud' — that allows it to connect with other components without knowing their internal details. A common Flutter widget like Padding is used as a practical example, since it handles only spacing and accepts any widget as a child, making it inherently reusable. The guide contrasts this with tightly coupled widgets, such as a PriceTag that simultaneously manages both visual styling and content, which limits reuse and forces code duplication. Atuoha also emphasizes that good modular design should allow behavior to be swapped out — for example, a cart button should not need to know whether it calls a REST API, writes locally, or logs to a console.

0
ProgrammingDEV Community ·

Harness Engineering: Why AI Context Design Is Now a Core Dev Responsibility

Harness Engineering refers to the practice of building structured environments that control how AI models access tools, context, and resources — going beyond simply choosing which model to use. A real-world example illustrates the cost of ignoring it: a product manager querying ChatGPT about a production bug received a hallucinated table name because the model had no schema context, wasting significant debugging time. A well-designed harness addresses this through steering files, targeted MCP servers that return only relevant data, and model routing — one team observed token usage drop from roughly 50,000 to 15,000 on a specific task after improving context precision. Mature harness setups also include granular permissions, mandatory human-in-the-loop checkpoints for sensitive actions, and full observability with audit trails and cost metrics. The article argues that developers who understand harness design have a responsibility to propagate it across their organisations, equipping non-technical colleagues like PMs with safe, context-aware AI tooling rather than leaving them to rely on generic chat interfaces.

0
ProgrammingDEV Community ·

AI Speeds Up Drafting But Coordination Bottlenecks Still Delay Business Workflows

AI tools can rapidly generate draft responses to complex business documents like security questionnaires, but the overall process often stalls due to unresolved approvals, unclear ownership, and coordination gaps that drafting assistance cannot fix. A faster draft can actually worsen bottlenecks by flooding a small group of reviewers with more material to check alongside existing workloads. The core issue is that completing a business process requires decisions, verified evidence, authorized sign-offs, and proper handoffs — steps AI currently struggles to replace. Experts argue that AI investments should be evaluated against the full workflow rather than just the drafting stage, since a populated document is an intermediate step, not a finished deliverable. Before adopting new tools, organizations are advised to audit recent workflows to identify exactly where delays occurred and what finally resolved them.