What does the following code do? SensorManager mgr = (SensorManager) getSystemService(SENSOR_SERVICE); List<Sensor> sensors = mgr.getSensorList(Sensor.TYPE_ALL); for (Sensor sensor : sensors) { System.out.println(""+sensor.getName()); }

Question:What does the following code do? SensorManager mgr = (SensorManager) getSystemService(SENSOR_SERVICE); List<Sensor> sensors = mgr.getSensorList(Sensor.TYPE_ALL); for (Sensor sensor : sensors) { System.out.println(""+sensor.getName()); }

1.prints names of all available sensors in device

2.prints names of all available sensor types in device

3.prints names of all sensors which are not available

4.none of above


Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!