I am developing an android app for my project, I need to find room temperature as part of it. I am using Droid 2 A955 model for testing.
My Questions are:
Take a look at the Sensor class in the documentation.
You need to do something along the lines of this:
public class SensorActivity extends Activity, implements SensorEventListener {
private final SensorManager mSensorManager;
private final Sensor mTemp;
public SensorActivity() {
mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
mtemp = mSensorManager.getDefaultSensor(Sensor.TYPE_TEMPERATURE);
}
protected void onResume() {
super.onResume();
mSensorManager.registerListener(this, mTemp, SensorManager.SENSOR_DELAY_NORMAL);
}
protected void onPause() {
super.onPause();
mSensorManager.unregisterListener(this);
}
public void onAccuracyChanged(Sensor sensor, int accuracy) {
}
public void onSensorChanged(SensorEvent event) {
}
}
This should give you access to the temperature sensors in it's own activity.
Play with this and see what you can find. The documentation has great examples for other types of sensors, the temp sensor should be even simpler than most of the provided ones.
Hope this helps!