Android Question How to Flash the Camera's Flash??

Cableguy

Expert
Licensed User
Longtime User
Hi guys,

This may seem a very basic question but I can't understand the procedure...
I need to make the Flash... Flash! a bit like a stroboscope does.
How do I do that?
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi guys,

This may seem a very basic question but I can't understand the procedure...
I need to make the Flash... Flash! a bit like a stroboscope does.
How do I do that?
While using the camera or just the flash by itself?
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
it will be while using the camera, but NOT to take pictures, just for the visual efect
 
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
Last edited:
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
So, coming back to this,
@Johan Schoeman , I got your lib to work, but it's too slow to call on/off the flash, and it is blocking one of my animations...

What I need to accomplish is:
I have a camera preview, with a small overpanel animation, and I want to strobr the flash while playing the animation...
How???
 
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
So, coming back to this,
@Johan Schoeman , I got your lib to work, but it's too slow to call on/off the flash, and it is blocking one of my animations...

What I need to accomplish is:
I have a camera preview, with a small overpanel animation, and I want to strobr the flash while playing the animation...
How???
I guess you will probably have to run the animation in a different thread and not on the main thread....
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I can't get the flash to strobe as quickly as in your morse code app, how can I achieve that?
Turning the flash on from the cameraEx class has no impact in the animation, but if I try in a timer to turn on and off the flash, most of the times it fails to comit the parameters, almost like it timed out the request to connect to the camera...
How would I go about the threading? I never worked with that!
 
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
the main issue I see with using your approach It's that I also need to see the camera's preview, so the camera lib will block the access to the flash by your code...
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I'm not exactly sure what I did differently, but I got it to work exactly as I want it to.
Using a Timer, I am now able to blink the Flash Led.
One thing to Notice However is that, sometimes, if the timer interval is too short, the call to the CameraEx.FlashMode will fail.
So I guess it's also an hardware issue, being it CPU or Camera related... I will have a play with it on different devices
 
Upvote 0
Top