Gp2mv3
Gp2mv3

Reputation: 1451

Detect car parking efficiently on Android

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.

Upvotes: 2

Views: 517

Answers (1)

323go
323go

Reputation: 14274

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.

Upvotes: 2

Related Questions