How to get the brightness level from the camera Android -
i want brightness level android camera.
i need display light level detected android camera, there posibility ?
private final sensormanager msensormanager; private final sensor mlightsensor; private float mlightquantity; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); // obtain references sensormanager , light sensor sensormanager = (sensormanager)getsystemservice(sensor_service); lightsensor = sensormanager.getdefaultsensor(sensor.type_light); // implement listener receive updates sensoreventlistener listener = new sensoreventlistener() { @override public void onsensorchanged(sensorevent event) { lightquantity = event.values[0]; } } // register listener light sensor -- choosing // 1 of sensormanager.sensor_delay_* constants. sensormanager.registerlistener( listener, lightsensor, sensormanager.sensor_delay_ui); }
Comments
Post a Comment