I am working in a project, it doesn't work and I suppose that the error is here:
should I write something in manifest.xml
when I want to work with sensors : compass, gyroscope and accelerometer?
Thanks
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="true" />
you have to declare this in manifest.xml
Provide permissions in manifest.
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
And also check below work:
sensorManager.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_NORMAL);
sensorManager.registerListener(this, magnetometer, SensorManager.SENSOR_DELAY_NORMAL);
Do not forget to unregister them.
More: http://developer.android.com/reference/android/hardware/SensorManager.html
Note: Android SDK folder also contains some helpful sensor sample applications
mark True or voteup if helpful...
Manifest is the class where you can only write what application contains: application version, activitites, permissions etc.
What type of data you want to entering. If you want to enter string. so place it in strings.xml
.