List of utility methods to do Camera Check
boolean | sizeSupported(Camera.Parameters cp, CamcorderProfile profile) size Supported List<Camera.Size> sl = cp.getSupportedVideoSizes(); if (sl == null) sl = cp.getSupportedPictureSizes(); for (Camera.Size s : sl) { if (profile.videoFrameWidth == s.width && profile.videoFrameHeight == s.height) return true; return false; |
boolean | hasFlash(Camera mCamera) Check if this device has flash if (mCamera == null) { return false; Camera.Parameters parameters = mCamera.getParameters(); if (parameters.getFlashMode() == null) { return false; List<String> supportedFlashModes = parameters ... |
Point | findBestPreviewSizeValue( Camera.Parameters parameters, Point screenResolution) find Best Preview Size Value List<Camera.Size> rawSupportedSizes = parameters .getSupportedPreviewSizes(); if (rawSupportedSizes == null) { Log.w(TAG, "Device returned no supported preview sizes; using default"); Camera.Size defaultSize = parameters.getPreviewSize(); if (defaultSize == null) { throw new IllegalStateException( ... |