1. Download our Official Android App: Forums for Android!
  2. We apologize for the disruption in email services! They are sending out now, but there is a backlog, so it may take a little time to catch up.

FlashLight that uses Camera Flash

Discussion in 'Android Devices' started by lobe50, Nov 7, 2009.

  1. eclipsed4utoo

    eclipsed4utoo Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    435
    Joined:
    Nov 12, 2009

    Nov 12, 2009
    435
    27
    43
    Software Developer
    Florence, SC
    woot....ok..got the flash to come on
     

    Advertisement

  2. drpull

    drpull Newbie
    Rank:
    None
    Points:
    15
    Posts:
    24
    Joined:
    Nov 17, 2009

    Nov 17, 2009
    24
    0
    15
    Nice! Yeah, i've got some catching up to do obviously, but i'm sure it won't be that hard. Are you basically doing the whole make it autofocus thing?
     
  3. eclipsed4utoo

    eclipsed4utoo Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    435
    Joined:
    Nov 12, 2009

    Nov 12, 2009
    435
    27
    43
    Software Developer
    Florence, SC
    yeah....I am at the same point as Chet. I can get it to keep autofocusing but there is a pause between each one....so it's kinda like a strobe light.
     
  4. drpull

    drpull Newbie
    Rank:
    None
    Points:
    15
    Posts:
    24
    Joined:
    Nov 17, 2009

    Nov 17, 2009
    24
    0
    15
    Interesting. Sounds like we'll have to wait and see what the December 11th update is going to include. Hopefully they'll toss in the torch and red eye modes.
     
  5. Chet

    Chet Member
    Rank:
    None
    Points:
    15
    Posts:
    65
    Joined:
    Oct 31, 2009

    Oct 31, 2009
    65
    0
    15
    What mechanism are you using to get continuous auto-focusing? I have tried two.
     
  6. eclipsed4utoo

    eclipsed4utoo Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    435
    Joined:
    Nov 12, 2009

    Nov 12, 2009
    435
    27
    43
    Software Developer
    Florence, SC
    with a while loop. inside of it, I do the autoFocus method.

    This is done in a background thread.

    I can get it down to about 1 second or a little less, but there's still that "off" period that makes it a strobe light.

    Also, if I don't show the Preview on the screen, the flash doesn't come on. Don't know how to get around that.
     
  7. Chet

    Chet Member
    Rank:
    None
    Points:
    15
    Posts:
    65
    Joined:
    Oct 31, 2009

    Oct 31, 2009
    65
    0
    15
    autoFocus is only valid after startPreview() has been called. However, I have found that you can call stopPreview() immediately after startPreview(). You never see the preview and the flash still works. :)
     
  8. Chet

    Chet Member
    Rank:
    None
    Points:
    15
    Posts:
    65
    Joined:
    Oct 31, 2009

    Oct 31, 2009
    65
    0
    15
    I am getting better results from putting an autoFocus call in the onAutoFocus callback.
     
  9. eclipsed4utoo

    eclipsed4utoo Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    435
    Joined:
    Nov 12, 2009

    Nov 12, 2009
    435
    27
    43
    Software Developer
    Florence, SC
    I had it there, but the "off" period was still pretty long. I was able to get the "off" period to be shorter with the background thread.
     
  10. eclipsed4utoo

    eclipsed4utoo Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    435
    Joined:
    Nov 12, 2009

    Nov 12, 2009
    435
    27
    43
    Software Developer
    Florence, SC
    awesome...so that part is fixed now. so I guess we are at the same point. Figuring out the "off" period between the flashes.
     
  11. Chet

    Chet Member
    Rank:
    None
    Points:
    15
    Posts:
    65
    Joined:
    Oct 31, 2009

    Oct 31, 2009
    65
    0
    15
    hum... so how often are you calling autofocus in your background thread? infinite loop or a timer? I was running a timer before and was getting more off period. I believe the timer's run method is executed in its own thread.
     
  12. eclipsed4utoo

    eclipsed4utoo Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    435
    Joined:
    Nov 12, 2009

    Nov 12, 2009
    435
    27
    43
    Software Developer
    Florence, SC
    infinite until a button is clicked. the while loop checks a public variable for the class. if that variable is true, it continues to call the autoFocus(). so when the button is clicked, I just set that value to false, and it stops.
     
  13. Chet

    Chet Member
    Rank:
    None
    Points:
    15
    Posts:
    65
    Joined:
    Oct 31, 2009

    Oct 31, 2009
    65
    0
    15
    Got it working straight-up! no auto focusing tricks! :D

    more to come...
     
  14. prerunnerseth

    prerunnerseth Android Enthusiast
    Rank:
    None
    Points:
    53
    Posts:
    384
    Joined:
    Nov 10, 2009

    Nov 10, 2009
    384
    89
    53
    <waiting>
     
  15. xtremely4

    xtremely4 Newbie
    Rank:
    None
    Points:
    35
    Posts:
    21
    Joined:
    Nov 14, 2009

    Nov 14, 2009
    21
    0
    35
    Sweet...anxiously awaiting!!!:D
     
  16. drumcrazy

    drumcrazy Newbie
    Rank:
    None
    Points:
    35
    Posts:
    27
    Joined:
    Nov 6, 2009

    Nov 6, 2009
    27
    0
    35
    I'm excited :)
     
  17. hounddoglgs

    hounddoglgs Newbie
    Rank:
    None
    Points:
    15
    Posts:
    19
    Joined:
    Nov 13, 2009

    Nov 13, 2009
    19
    0
    15
    Software Developer
    Huntsville, AL
    DroidLight appears to have been removed for some reason.
     
  18. eclipsed4utoo

    eclipsed4utoo Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    435
    Joined:
    Nov 12, 2009

    Nov 12, 2009
    435
    27
    43
    Software Developer
    Florence, SC
    Is it simply a combination of the camera settings?
     
  19. Chet

    Chet Member
    Rank:
    None
    Points:
    15
    Posts:
    65
    Joined:
    Oct 31, 2009

    Oct 31, 2009
    65
    0
    15
    No. Nothing to do with the camera. This is the direct "turn it on" command we were looking for.
     
  20. Chet

    Chet Member
    Rank:
    None
    Points:
    15
    Posts:
    65
    Joined:
    Oct 31, 2009

    Oct 31, 2009
    65
    0
    15
    Ok, so who would like to try it out? I am willing to email my test .apk if someone wants to test it. You will have to enable installing apps from "Unknown Sources".
     
  21. allen2288

    allen2288 Lurker
    Rank:
    None
    Points:
    5
    Posts:
    8
    Joined:
    Nov 18, 2009

    Nov 18, 2009
    8
    0
    5
    Hello Chet,
    Thanks for working on this project, I'm about to start tackling progging on android soon. I am willing to beta this for you. If interested...


    Thanks.
     
  22. sublimnl

    sublimnl Well-Known Member
    Rank:
    None
    Points:
    36
    Posts:
    151
    Joined:
    Nov 6, 2009

    Nov 6, 2009
    151
    2
    36
    Ill test as well. Sublimnl at yahoo dot com
     
  23. -Myk-

    Rank:
    None
    Points:
    15
    Posts:
    69
    Joined:
    Nov 6, 2009

    Nov 6, 2009
    69
    0
    15
    murphy.ms at gmail dot com
     
  24. 4lph4num3r1c

    4lph4num3r1c Well-Known Member
    Rank:
    None
    Points:
    63
    Posts:
    191
    Joined:
    Jan 9, 2009

    Jan 9, 2009
    191
    42
    63
    Me too please. I pm'd you me email. Thanks!
     
  25. Branndon

    Branndon Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    481
    Joined:
    Nov 10, 2009

    Nov 10, 2009
    481
    30
    43
    Website Developer
    Orange County, CA
    androidforums
    at
    416bc
    .
    com


    Yes that's the actual email. It's a catch all.
     

Share This Page

Loading...