incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Maj <>
Subject [Android] Accelerometer plugin rewrite
Date Mon, 14 May 2012 22:26:46 GMT
Hey all,

Part of the 1.8 work was to change the accelerometer plugin to line it up
more with the way the Geolocation plugin was rewritten. Essentially:

- store callback ids in the plugin for incoming requests
- privatize start() and stop() methods
- start and stop the accel listener based on how many callbacks are
waiting for accel data

The Accel plugin now should implement only 3 actions: getAcceleration,
addWatch, clearWatch. The plugin should handle calling start() and stop()
privately on its own. This also eliminates the awkward "getTimeout" and
"setTimeout" actions, and now we are ensured that the accelerometer plugin
stops as soon as possible (namely, when no callbacks in JS are waiting for
acceleration values), instead of waiting for the timeout period to expire.

I added a few extra things to the android plugin rewrite as well, mainly
checking for accuracy level before returning values to the web view.

If any Android maintainers want to take a look at the rewrite, please have
a look at the 463 branch on the Apache git repo [1]. Would love feedback
if you have the time to look it over.

I will be merging it later this week unless someone has any issues with it.



View raw message