1

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?

Cartesian Theater
  • 1,920
  • 2
  • 29
  • 49

2 Answers2

3

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.

Kratz
  • 4,280
  • 3
  • 32
  • 55
1

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.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491