How to measure radiation(Non Ionizing) [Android SDK] for a Radiation measuring application

51 Views Asked by At

I need a way to measure the non-ionizing radiation around me through the smart phones. I have found several applications on the google Play Store which have an RF meter functionality which measures the Radio Frequency. Through my application, I am only able to measure the Electromagnetic fields using the inbuilt sensors. However, I need to measure the radiations of type Radio Frequency.

public class NonIonizingRadiationActivity extends AppCompatActivity implements SensorEventListener {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_non_ionizing_radiation);
        manager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
        sensor = manager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
    }

    @Override
    public void onSensorChanged(SensorEvent sensorEvent) {
        float azimuth = Math.round(sensorEvent.values[0]);
        float pitch = Math.round(sensorEvent.values[0]);
        float roll = Math.round(sensorEvent.values[0]);

        double tesla = Math.sqrt((azimuth*azimuth) + (pitch*pitch) + (roll*roll));

        
    }

    @Override
    public void onAccuracyChanged(Sensor sensor, int i) {

    }

    @Override
    protected void onResume() {
        super.onResume();

        if(sensor!=null){
            manager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_NORMAL);
        }
        else{
            Toast.makeText(this, "Error, Sensor not available/supported.", Toast.LENGTH_SHORT).show();
        }
    }

    @Override
    protected void onPause() {
        super.onPause();

        manager.unregisterListener(this);
    }
}

Reference links (from playstore): https://play.google.com/store/apps/details?id=com.tm.radiation.meetr&hl=en-IN ; https://play.google.com/store/apps/details?id=com.dainaapp.emfdetector.emfmeter.ultimateemffinder

0

There are 0 best solutions below