How to refresh app upon shaking the device?

Here is an example code. Put this into your activity class: /* put this into your activity class */ private SensorManager mSensorManager; private float mAccel; // acceleration apart from gravity private float mAccelCurrent; // current acceleration including gravity private float mAccelLast; // last acceleration including gravity private final SensorEventListener mSensorListener = new SensorEventListener() { public … Read more

HTML sensor data

Your question as asked is much too broad for this site. With that said, here’s how I implemented a solution: Create a node.js server. You will want to be able to serve up html pages. Add socket capability. Generate a webpage for the mobile device. The webpage will use the device orientation API to determine … Read more