Imagine you’re a seismologist. In addition to studying data from earthquakes after the fact, you’d like to get out warnings to help save lives the moment one hits. To do that, you’re going to need enough seismometers to guarantee that you have one near the epicenter.

Seismometers cost money to install and operate properly—but everyone with a smartphone has a passable one in their pocket. Harness enough of them and you’ve got yourself a crowdsourced earthquake-detection network that could work absolutely anywhere.

Researchers have played with similar ideas in the past but have mainly had to rely on dedicated devices, along with volunteers who were willing to connect them to their computers. But in a paper published today in Science Advances, a group led by University of California-Berkeley’s Qingkai Kong describes an Android app (available now) that’s up to the task.

The researchers first had to establish how noisy the data from phone accelerometers was, so they ran several tests on phones, still and shaken. The accelerometers seem to be getting better in newer phones, but the researchers say phones can (at a minimum) detect a magnitude 5 earthquake within 10 kilometers of the epicenter—and farther away for larger, more dangerous earthquakes.

They developed an algorithm to pick out earthquakes from everyday motion and jostling with minimal false alarms. When that happens, the app sends its data and the phone’s location to a central server. If at least 60 percent of app users in the area register an earthquake at the same time, they assume it’s the real deal and sound the alarm.

This app could eventually be integrated with early warning systems built on proper seismometers, or it could stand on its own in regions without that kind of infrastructure. With a good system for delivering warnings, even one minute of warning is enough to let people take cover or slow trains to a stop before the seismic waves arrive.

Science Advances, 2016. DOI: 10.1126/sciadv.1501055 (About DOIs).