Urgent.News

What's breaking now, across thousands of outlets.

Tech

How Two Android Intent Bugs Broke My App’s Red Alert Button

My Android app's emergency button failed three ways: two opposite Intent races and a usability trap. The fix, with code, from a real app built for my mother.

How Two Android Intent Bugs Broke My App’s Red Alert Button

The Android app named CareVocal was created for the author's mother who lives in a village and communicates with family living in cities. The app has three buttons: green for feeling good, yellow for something hurts, and red for needing help. The red button fails to work correctly due to two bugs. The first bug occurs when two intents, one opening the SMS app and the other opening the dialer, are launched back-to-back.

Due to the OS's window transition, only the last intent survives, leaving only the dialer open. The second bug arises when a delay is added between the intent launches. During this brief pause, the SMS app takes the foreground, blocking the second intent from launching. To fix the second bug, the code should use a single call that launches both the SMS and dialer as one operation, ensuring the dialer is the visible option.

The third issue is the recording feature that starts automatically after the first tap, which fails when the user is dizzy or unable to speak. The solution is to separate the recording function, allowing the first tap to handle only safe actions like saving the entry and pre-filling the dialer, while starting the recording on a second deliberate tap.

The author emphasizes the importance of testing failure paths on real devices with real data to avoid hidden bugs in the development process.

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

Read the original at hackernoon.com →

More in Tech

Australia’s Medicare breach reveals a new kind of cyber threat. How must NZ respond?

The Manage My Health hacking breach exposed weaknesses in New Zealand’s digital defences. But the rise of autonomous AI agents poses a very different threat.

  • Over 400,000 medical files breached in December, prompting security mandates.
  • AI agents, like OpenAI's autonomous agent, pose new cyber threats.
  • New Zealand must upgrade access controls and build AI system testing expertise.

Modelling The Real World: Object Oriented Programming

So far, functions have been the main way to organize code, break a problem into small, reusable pieces of logic. But some problems aren't just about logic; they're about things a customer, a bank…

  • Object-oriented programming organizes code into objects
  • Bundles data and behavior within single units
  • Simplifies managing complex entities

More from Friday 2 October →