Search code examples
androidandroid-sensors

TYPE_MAGNETIC_FIELD Android No data


I have written some simple code for the Galaxy Tab 7 to show the TYPE_MAGNETIC_FIELD data. Unfortunately this does not provide any data.

I can see a TYPE_MAGNETIC_FIELD sensor (have checked it exists). I can successfully add a an event listener to it, however I never get any data from it. Other sensors work fine such as light and accelerometer. This is on a Galaxy Tab 7.

onSensorChanged(SensorEvent event) is never fired for a case Sensor.TYPE_MAGNETIC_FIELD:

As such I get no data from the Magnetic Field Sensor.

Anyone else getting this problem or know of a solution to it ?

Many Thanks.


Solution

  • Turns out the Sensor was broken. =((