2

I'm currently trying to detect when a car is parked via Android. I was thinking of using the Android Detected Activities (https://developers.google.com/android/reference/com/google/android/gms/location/DetectedActivity) and detect a switch between IN_VEHICLE and ON_FOOT. But it means polling the device regularly so it's not really power efficient.

Do you think it's reliable enough ? Also, maybe there is a better solution ? What do you think ? I also think about using Bluetooth and detect when the car's bluetooth is unpaired but everybody doesn't use Bluetooth.

Gp2mv3
  • 1,435
  • 20
  • 33
  • your guess on "detect a switch between IN_VEHICLE and ON_FOOT" should be enough but it depends on how do you want to detect this. can you wait 1 min? 30s? 5s? how fast do you need the answer? – gustavogbc Apr 24 '17 at 19:27
  • The idea is to send a notification when the user parks, so it's fairly fast... – Gp2mv3 Apr 24 '17 at 21:33
  • Did you obtain something accurate using this kind of detection (the transition from in veichle to walking)? – iGenio Apr 12 '18 at 16:20

1 Answers1

2

I've used the ActivityRecognitionApi in one app, and it's fairly accurate. You are not "polling" the device, but rather subscribe to activity changes. This means there's really no overhead beyond what the phone is doing anyway.

323go
  • 14,143
  • 6
  • 33
  • 41