Swithing on the camera Flash light dynamically in android -
Swithing on the camera Flash light dynamically in android -
all
i doing barcode scanning app in android.in have turn on photographic camera flash lite dynamically , doing using next code
mcamera = camera.open(); camera.parameters params = mcamera.getparameters(); params.setflashmode(camera.parameters.flash_mode_torch); mcamera.setparameters(params); mcamera.startpreview(); but showing exception like
error/androidruntime(17291): java.lang.runtimeexception: fail connect photographic camera service at line
mcamera = camera.open(); i think exception because of while scanning barcode photographic camera in open mode , here trying open photographic camera again.
is there way turn on flash lite without open photographic camera 1 time again ? , how?
you can reuse existing photographic camera object , setparameters on that. note not devices back upwards flash mode torch. some, fascinate/epic (who utilize flash mode on) cannot alter state without disconnecting , reconnecting camera.
android camera flashlight
Comments
Post a Comment