Detect if Android is in the car

I am trying to write an Android application that needs to determine if Android is currently in the car or not using only accelerometers. Basically, the application should determine if the person holding it is walking or in the car. For walking, I just discovered bursts in the accelerometer readings, but I can not find any characteristics of the car. How exactly should I approach this problem?

+4
source share
2 answers

First of all, the problem posed is insoluble - a phone that sits perfectly on a parked car (or, for that matter, works at a constant speed) is completely indistinguishable from one sitting on a table if you limit yourself to the accelerator readings.

For heuristics, I just went and wrote down samples and then selected detection algorithms. I assume that the characteristics for (urban) traffic will be attacks of almost constant acceleration for several seconds, up to 10-20 m / s, and some more sharp braking around the same full speed. I don’t think that you can integrate the accelerometer readings well enough to accurately track something like a car accelerating smoothly to speed on a cruise, staying there for an hour, and then rolling for a long time.

What are you trying to achieve?

+3
source

Obviously, the typical biggest differences are acceleration and speed (and possibly constant speed). My suggestion, create a profiling application and go to several modes of transport.

+1
source

Source: https://habr.com/ru/post/1380228/


All Articles