0

I want to know if my android phone has been moved at all in the last 20 minutes.

I was thinking of using the step counter, but my phone doesn't have one (only on high end models it seems), so I'm out of luck there.

I was also thinking about using the gyro, but when the screen is off, then so to goes the gyro (or so I've read.. I would love to be wrong)

I'm thinking of using the cameras, or something else.

Anyone know of a way to figure out if the user has moved their phone. Or better yet walked with it in the last N minutes?

Super cool if there is an answer here. I was sort of thinking of bluetooth and IOT tracking, but that seems like a bazooka for a fly kind of thing.

Thanks

Phantômaxx
  • 37,352
  • 21
  • 80
  • 110
baash05
  • 4,232
  • 11
  • 57
  • 93

1 Answers1

2

You could use the Activity Recognition API for this. The Activity Recognition API detects how the user is using the device. It allows you to listen to certain activity changes. You could get notified when the user starts or stops a certain activity such as walking, driving, or when the device is still. You would have to add some custom logic to check if the device has moved within the last 20 minutes using these activity changes.

There is some delay in the API because the sensors are checked periodically. For our use-case, detecting if the user in a vehicle, we had delays off approximately 15-20 seconds.

Rockney
  • 9,690
  • 2
  • 19
  • 25