How to Declare a SensorManager

SensorManager was added in API Level 1
SensorManager lets you access the device's sensors

1. In the MainActivity.java file, add the below line to the import section.

import android.hardware.SensorManager;

2. Add the below line to the onCreate method.