SShortSingh.
Back to feed

How One Developer Built a Battery-Efficient Geofencing Engine for Android

0
·35 views

A developer building Muffle, an Android app that auto-silences phones based on location, encountered severe battery drain when using 50-meter geofence radii, losing 15% battery in under four hours. To fix this, they designed a tiered proximity system that uses coarse network location to pre-warm the geofence before engaging the more power-hungry GPS chip. The number of registered geofences per user was capped to prevent the LocationManager from being overwhelmed. An hourly AlarmManager fallback was also added to maintain data integrity when geofencing intents are delayed under memory pressure. Unexpectedly, the developer found that mismanaging the BroadcastReceiver lifecycle — not GPS usage — was the single largest contributor to battery drain.

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
ProgrammingHacker News ·

Turbo Pascal Compared Against Smaller Programs and Objects from Other Domains

A 2011 blog post on prog21.dadgum.com lists various items that are smaller in size than the Turbo Pascal compiler. The article is shared on Hacker News, where it received 9 points and one comment. The source text provided is only metadata, so the specific comparisons and their details are not included here. The piece is presented as a retrospective look at the compiler's compact footprint.

0
ProgrammingDEV Community ·

H-1B holders may enter up to 10 days early but cannot begin work before the petition start date

Under U.S. immigration regulations, H-1B workers and their H-4 dependents can be admitted up to 10 days before their approved petition start date. The same window extends up to 10 days after the end date, and USCIS can grant the status inside the country on similar terms. Employment, however, is permitted only during the petition's validity period unless another work authorization applies. The rule, found at 8 CFR 214.1(l)(1), was set by DHS in a 2016 final rule that took effect in January 2017. The extra days are meant to allow time to enter, prepare for employment, or depart and pursue other lawful status options.

0
ProgrammingDEV Community ·

Author stress-tests a containerized task system and explains why hard isolation was left unbuilt

The final post in a series on agent execution infrastructure assembles earlier fixes and runs a load test of 20 concurrent one-minute tasks against a small container pool. The test confirmed that no tasks were lost, surplus work queued, users received queue positions instead of errors, and progress stayed queryable. The author stresses that this load level is too small to reveal real failure modes, and that failure-injection experiments need a multi-node cluster the local laptop setup cannot provide. He also admits that tasks held by a dead container are not automatically re-dispatched, which would require a task-state table and timeout rules. The post closes by noting that stronger isolation, such as the shared kernel's role in container boundaries, was designed on paper but not implemented.

0
ProgrammingDEV Community ·

Experts urge AI agent risk registers covering seven areas beyond prompt injection

A DEV Community article argues that treating prompt injection as the sole AI security concern leaves most risks unaddressed, since roughly 60 risks span data, models, software security, agent actions, human operations, governance, and societal harm. It notes that falling costs of AI-assisted vulnerability discovery, illustrated by recent PHP flaws found with reasoning models, weaken the defense that attackers won't bother. The author uses a hypothetical consultant who granted a summarization assistant deletion and sharing rights it did not need, showing how excessive permissions enlarge the damage an injected instruction can cause. The piece draws on OWASP, NIST, the EU AI Act, and MIT's AI Risk Repository to offer a seven-group map as a checklist for building a risk register. It stresses limiting agent permissions to what each task requires, since the blast radius of an attack depends on granted authority rather than the prompt alone.