开发者

Android support for Torch Mode

I've tried looking around for a particular answer to this question but can't find it. Hopefully someone here can help!

I'm trying to get Torch mode to work on all phones (The main problems seem to be Droid X, LG Ally etc.) but can't get it to work for everyone.

I set the Torch mode like this:

mParameters = mCamera.getParameters();
mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
mCamera.setParameters(mParameters);

This seems to work fo开发者_如何学Gor most phones but not some. I've since implemented a check like this:

if(mCamera.getParameters().getFlashMode() != null){ ... Set Torch ... }
else { Toast: "Unsupported Phone"; }

(That's the short hand version)...

Any ideas? Thanks a lot!


It isn't necessarily safe to leave the flash continuously on if the hardware isn't designed to dissipate that kind of thermal influx. Don't look for a way to circumvent the built-in protection on such phones.

In addition to heat concerns, some flashbulb circuits pre-charge a capacitor and then discharge it quickly through the light. There isn't any capability for continuously supplying a current large enough to drive the light.

In either case, you're dealing with a hardware restriction and you can't overcome it in software.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜