List all sensors android

In this article let’s discuss about List all sensors android. Let’s go through the following methods without any delay 🙂

Method 1:

    // Get the SensorManager 
    SensorManager mSensorManager​ = (SensorManager) getSystemService(SENSOR_SERVICE);

    // List of Sensors Available
    List msensorList = mSensorManager.getSensorList(SensorManager.SENSOR_ALL);

// source https://stackoverflow.com/questions/2858161/display-an-android-sensors-list

Method 2 :

((SensorManager) getSystemService(SENSOR_SERVICE)).getSensorList(SensorManager.SENSOR_ALL);

Hope the above methods works for you. Happy Learning and get back to us Anytime.

Realted Posts : Program in assembly language to find even numbers from 1 to 10