Simulate ActivityRecognition events in an Android emulator

Is there a good way to simulate DetectedActivity.IN_VEHICLE in an Android emulator. I'm currently trying to get an ActivityRecognitionApi to detect an event by sending commands via telnet.

sensor set acceleration {x}:{y}:{z}
geo fix {latitude} {longitude}
+4
source share
2 answers

Faced the same problem and got the same cricket noises as you. I partially circumvented this problem by refactoring, so that my detected activity is processed in the AsyncTask native class. Then I wrote a series of units that could pass event information to this activity detection processing class. Given that android has a limit on the number of asynchronous operations that can be performed for each object, my junit creates runnables in a loop to interact with the activity processing class.

I also found the otto and dagger2 libraries that can work for inputting events on the android bus. Nevertheless, work continues, although ...

+1
source

, GPS . Google , , , , STILL.

Google :

, . , . .

, .

, , - Android - (. , "Yaw" ) ). ( ) IN_VEHICLE UNKNOWN GPS-.

Screenshot of virtual yaw sensors

0

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


All Articles