cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Sorokin (Akvelon)" <v-als...@microsoft.com>
Subject Device-motion plugin test failures on Android
Date Thu, 14 May 2015 16:46:44 GMT
Hi, community.

I am investigating device-motion plugin test failures on Android and I've found that if the
device (or emulator) is still, no SensorChanged events is being raised. So the plugin adds
accelerometer listener, waits for two seconds (no updates), removes accelerometer listener
and then calls fail callback.

I've come up with three different approaches to solve this problem:

1. We can pend the tests for Android.
2. We can save latest accelerometer value and pass it if no SensorChanged events is fired
in 2 secs. But this value can be outdated.
3. We can poll accelerometer continuously and don't add/remove listener. But I believe that
this approach can drain device battery.

What do you think, guys? Which way is best for us?

Thanks,
Alexander Sorokin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message