A Cordova plugin that detects and watch motion API.
cordova plugin add https://github.com/mrameezraja/cordova-plugin-motion-activity
- cordova.plugins.motionActivity.startActivity
- cordova.plugins.motionActivity.stopActivity
window.cordova.plugins.motionActivity.startActivity(function success(readings) {
console.log(JSON.stringify(readings));
// sample output
// { 'confidence': 2, 'unknown'; 0, 'stationary': 1, 'walking': 0, 'running': 0, 'cycling': 0, 'automotive': 0 }
}, function(error){
console.log(error);
})
window.cordova.plugins.motionActivity.stopActivity(function success() {
console.log('motion detection stopped');
}, function(error){
console.log(error);
})
- IOS
- Android (In Progress)