Turn ON/OFF Camera LED/flash light in Samsung Galaxy Ace 2.2.1 & Galaxy Tab

后端 未结 1 763
遇见更好的自我
遇见更好的自我 2020-12-01 08:05

I am turning ON Camera LED light using FLASH_MODE_ON.

Samsung Galaxy Ace have only three flash modes : on, off and auto.

FLASH_MODE_TORCH

相关标签:
1条回答
  • 2020-12-01 08:46

    I will soon released a new version of my app to support to galaxy ace.

    You can download here: https://play.google.com/store/apps/details?id=droid.pr.coolflashlightfree

    In order to solve your problem you should do this:

    this._camera = Camera.open();     
    this._camera.startPreview();
    this._camera.autoFocus(new AutoFocusCallback() {
    public void onAutoFocus(boolean success, Camera camera) {
    }
    });
    
    Parameters params = this._camera.getParameters();
    params.setFlashMode(Parameters.FLASH_MODE_ON);
    this._camera.setParameters(params);
    
    params = this._camera.getParameters();
    params.setFlashMode(Parameters.FLASH_MODE_OFF);
    this._camera.setParameters(params);
    

    don't worry about FLASH_MODE_OFF because this will keep the light on, strange but it's true

    to turn off the led just release the camera

    0 讨论(0)
提交回复
热议问题