android and camera flash
<p>I want to write application which will be used camera flash. I want the light to blink.  For now I have this code:</p>

<pre><code>void ledon() {
    cam = Camera.open(); 
    Parameters params = cam.getParameters();
    params.setFlashMode(Parameters.FLASH_MODE_ON);

    cam.setParameters(params);
    cam.startPreview();
    cam.autoFocus(new AutoFocusCallback() {
                public void onAutoFocus(boolean success, Camera camera) {
                }
            });
}
</code></pre>

<p>this part:</p>

<pre><code>        cam.autoFocus(new AutoFocusCallback() {
                public void onAutoFocus(boolean success, Camera camera) {
                }
            });
</code></pre>

<p>I dont know why its necessary but it wont work without it.</p>

<p>This code turn on led and turn off automaticly for about 2 seconds. I want to led will turn on e.g. for 5 sec then 3 sec led off and then again on for 4 seconds. How I can manually set periods of time in which led will be on and off. Is this possible? Thanks for any help.</p>

<p>PS. I have samsung galaxy ace.</p>
