0

I require my application to take 3 pictures via Nokia 5800 phone during night-time. I want to ensure that the camera's flash remains ON while taking pictures. How can I ensure it?

Hugo
  • 27,885
  • 8
  • 82
  • 98
Muhammad Maqsoodur Rehman
  • 33,681
  • 34
  • 84
  • 124

2 Answers2

3

You can use the AMMS(JSR-234) API's FlashControl. Here is a piece of code example that shows its use.

FlashControl flash = (FlashControl)
player.getControl("javax.microedition.media.control.camera.FlashControl");
if(flash!=null) {
    flash.setMode(FlashControl.FORCE_WITH_REDEYEREDUCE);
}
Gorkem Ercan
  • 3,220
  • 1
  • 18
  • 26
  • Cheers! My client's intended platform is S90 and not S60. The piece of code you have provided is indeed very useful for my requirement. Wonder if the same thing will work on S90? – Muhammad Maqsoodur Rehman Nov 02 '11 at 13:52
1

You need to use APIBridge.jar , this jar will allow you to call native camera application. So you can call Native Camera, application from your code. Native camera Application has default setting for Flash.

Search on google for APIBridge.jar , you will find it will example. You may also find other useful example for reading inbox, contact list etc.

Lucifer
  • 29,392
  • 25
  • 90
  • 143
  • Hi Kalpen! Why should i specifically go for APIBridge.jar? Why do you think that i need to use this library and why would javax.microedition.media.control.camera.FlashControl won't be enough for my requirement. Thanks – Muhammad Maqsoodur Rehman Nov 04 '11 at 14:10
  • 1
    Hi Maxood, In one of my project, I used that APIBridge.jar when I was not able to use FlashControl from J2ME Code for Nokia E72 Mobile. I guess Nokia is not allowing developer to use Flash Using J2ME Code. This is the reason I asked you to go for APIBridge.jar . If you are developing for other than Nokia Mobile then you may you FlashControl from J2ME code. – Lucifer Nov 05 '11 at 03:36