set flash mode camera.parameters android 1.5

3k Views Asked by At

I'm trying to use the camera in an Android app using the 1.5 API. I want the camera to flash for every picture. However, when I looked at the API for camera.parameters, the setFlashMode() method is only supported for 2.0 and higher. Yet my Cliq XT, which runs 1.5, has a flash that I can set in the menu - I take this to mean there is a way to do this for the 1.5 API, though I was unable to find it.

Does anyone know how to set the flash mode using the 1.5 API?

2

There are 2 best solutions below

0
Kratz On BEST ANSWER

You can use the following code to set the flash in older versions of the API:

Parameters params = camera.getParameters();
params.set("flash-mode", "on");
camera.setParameters(params);

I just guessed on the values to send to the .set method, but I just tested it and this turns on the flash.

0
CommonsWare On

Does anyone know how to set the flash mode using the 1.5 API?

There is no API for that in 1.5, sorry. A device manufacturer is not limited by the public SDK and therefore can access capabilities that you, as a third-party developer, cannot.