Skip to main content

Posts

Showing posts from March, 2016

Accelerometer Basic Example - Detect Phone Shake Motion - Android Tutorial

In this example detecting Accelerometer Motion , when Accelerometer force value cross threshold showing an alert for motion detected. Use :    1. You can use this example in games based on Accelerometer Motion (Phone Tilt).      2. You can use this example for battery consumption when using GPS Calls.     Combine Screen Wake Sleep Example with this example to consume less battery when calling GPS calls.Later We will give combined example to consume less battery. Now follow the coding to develop this simple application 1. activity_accelerometer.xml <? xml version= "1.0" encoding= "utf-8" ?>   < RelativeLayout   xmlns: android = "http://schemas.android.com/apk/res/android"   xmlns: tools = "http://schemas.android.com/tools"     android :layout_width= "match_parent"     android :layout_height= "match_parent"     android :padd...