Wearable Sensors


 

  1. Accelerometer Sensor
  2. Magnetic Sensor
  3. Gravity Sensor
  4. Gyroscope Sensor
  5. Step Detector Sensor
  6. Signification Motion Sensor

 

1. Accelerometer Sensor

Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, select Wear Module(Mobile Module is Optional for this tutorial), create “Blank Activity” and click “Finish” button.

Step 2 : Open res -> layout -> activity_main.xml and add following code :

Step 3 : Open src -> package -> MainActivity.java and add following code :

Step 4 : Open AndroidManifest.xml and add following code :

Step 5 : Open build.gradle(Module: app) and add following code :

ScreenShot:

wearsensor accelerometer wearsensor accelerometer2

Download SourceCode

 

 

2. Magnetic Sensor

Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, select Wear Module(Mobile Module is Optional for this tutorial), create “Blank Activity” and click “Finish” button.

Step 2 : Open res -> layout -> activity_main.xml and add following code :

Step 3 : Open src -> package -> MainActivity.java and add following code :

Step 4 : Open AndroidManifest.xml and add following code :

Step 5 : Open build.gradle(Module: app) and add following code :

ScreenShot:

 wearsensor magnetic

Download SourceCode

 

 

3. Gravity Sensor

Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, select Wear Module(Mobile Module is Optional for this tutorial), create “Blank Activity” and click “Finish” button.

Step 2 : Open res -> layout -> activity_main.xml and add following code :

Step 3 : Open src -> package -> MainActivity.java and add following code :

Step 4 : Open AndroidManifest.xml and add following code :

Step 5 : Open build.gradle(Module: app) and add following code :

ScreenShot:

 wearsensor gravity wearsensor gravity2

Download SourceCode

 

 

4. Gyroscope Sensor

Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, select Wear Module(Mobile Module is Optional for this tutorial), create “Blank Activity” and click “Finish” button.

Step 2 : Open res -> layout -> activity_main.xml and add following code :

Step 3 : Open src -> package -> MainActivity.java and add following code :

Step 4 : Open AndroidManifest.xml and add following code :

Step 5 : Open build.gradle(Module: app) and add following code :

ScreenShot:

wearsensor gyro wearsensor gyro2

Download SourceCode

 

 

5. Step Detector Sensor

Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, select Wear Module(Mobile Module is Optional for this tutorial), create “Blank Activity” and click “Finish” button.

Step 2 : Open res -> layout -> activity_main.xml and add following code :

Step 3 : Open src -> package -> MainActivity.java and add following code :

Step 4 : Open AndroidManifest.xml and add following code :

Step 5 : Open build.gradle(Module: app) and add following code :

ScreenShot:

 wearsensor step detector

Download SourceCode

 

 

6. Signification Motion Sensor

Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, select Wear Module(Mobile Module is Optional for this tutorial), create “Blank Activity” and click “Finish” button.

Step 2 : Open res -> layout -> activity_main.xml and add following code :

Step 3 : Open src -> package -> MainActivity.java and add following code :

Step 4 : Open AndroidManifest.xml and add following code :

Step 5 : Open build.gradle(Module: app) and add following code :

ScreenShot:

 wearsensor signification motion wearsensor signification motion2

Download SourceCode