Credit: Pixabay/CC0 Public Domain

Google is rolling out a new feature for Android users to prevent them from getting too distracted by their smartphones.

On a support page, the tech giant said it is providing the "Heads Up" feature through a beta program on its Digital Wellbeing app, which Android owners can use to keep track of their smartphone habits such as time spent on their device.

Here's how it works: if you're walking with your smartphone unlocked, the feature will ping you with a reminder to pay attention to your surroundings.

The feature is expected to work while Android users jog or run as well.

"The app uses sensors in your phone that detect movement to understand whether or not you're walking, while the location is used to understand whether you're walking indoors or outdoors," reads the Google support page. Using as part of "Heads Up" is optional, Google says.