android - How to check is device camera enabled? -


is there way check is(/are) device camera(s) enabled ? if yes, should ?

if enabled, mean open or in use, yes, there way.

camera.open() give exception if camera in use.

so can make use of check if camera enabled, in use or if there camera.

/** how camera object savely */ public static camera getcamerainstance(){     camera c = null;     try {         c = camera.open(); // try camera     }     catch (exception e){         // camera not available (in use) or not exist     }     return c; // null returned if unavailable, or non existent } 

if camera in use want use it, call

camera.release(); 

and use yourself.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -