That's an awesome idea. But no, sorry I haven't tried it. You would probably use a version of morse code, this will be a very slow way to transfer data though and could cause you issues with epileptic users! Might be better to try using high pitch audio transmission.
The process would be used to transfer data to a piece of equipment so the phone would be pointed away from the user, although I take on board that reflection could still cause some users a problem. For the application a warning would probably suffice. Yes a series of simple codes is the idea. Binary coded not morse which is of course coded letters. But worth considering
How bright would the light need to be? You may have a chance using a flashing white (or whatever color is most easily received) panel on a black or contrasting background.
Cam.InitializeStatic("android.hardware.Camera")
Cam = Cam.RunMethod("open",Null)
Dim Par As JavaObject = Cam.RunMethod("getParameters",Null)
Par.RunMethod("setFlashMode",Array As Object("torch"))
Cam.RunMethod("setParameters",Array As Object(Par))
Been a while but update from tests are that although some control of the led is possible, it seems that it is not stable enough in the system to provide consistently equal width pulses needed for decoding. Using timer seems to have some problems which are probably system related in that timer seems not to have priority when kicked off so timings not stable. Someone else is doing tests which this post is based on so waiting for some more details. It may turn out to be unusable for transmit of binary data field.
I was able to get this sample to work on a Note 2 running Android 4.1.2
When I try to run it on a Note 3 with Android 4.4.2 it fails to turn the light on.
If I run the example in the CameraEx class / library - the light function works as expected.
Can only assume that they have changed permissions, or the hardware has a mask ! As for original idea of transmitting data I think that the chances of achieving stable pulse width's to decode is a pipe dream on Android, unless somebody knows differently. So for the time being I am abandoning this idea for communications.
I'm using the code above to turn a light on - not for pulse width modulated communication.
I'm hoping the author might have a simple solution to the problem I'm seeing.
I tried the recommended changes (above) - no joy.
I found a reference in an Android Forum that says.
"Try turning "Smart Stabilization" off...For some idiotic reason Samsung decided to bundle the "Night Mode" into the stabilization option, so more often than not, the phone will try to take pictures with longer exposure rather than firing up the flash."
Will try this later today and see if it solves the problem.
Is there a way to dump the cam.parameters - so I can see the correct name of the smart_stabilization parameter and maybe turn it off just ahead of activating the light?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.