New Delhi, July 23 -- With recent earthquakes rattling cities like Delhi and tremors felt across North India, knowing a quake is coming, even a few seconds early, can be the difference between panic and action. Most Android smartphones already have a built-in system to alert you before the worst of the shaking hits. You just need to know how to turn it on.

Your phone's accelerometer, the same sensor that knows when you rotate the screen, can detect the early tremors of an earthquake, known as P-waves. These are fast but not destructive. Once detected, your phone shares anonymous location and motion data with Google's servers.

If enough phones in an area pick up similar signals, the system confirms a quake is happening. Before the slower...