MotoTorch LED – LED Flashlight – My First Android Application
I have released my first Android application called MotoTorch LED. It is designed for the Motorola Droid and Motorola Milestone and uses it’s camera LEDs as a flashlight. It’s also has a widget that can be placed on one of the HOME screens. A simple click on the widget will turn the LEDs on, and clicking it again will turn them off. The widget can also turn off the screen when the LEDs are on.
This application is free.
IF YOU HAVE AN ISSUE, GO TO THE BOTTOM OF THIS POST. IF YOUR PROBLEM ISN’T COVERED, EITHER POST IN THE COMMENTS HERE, OR SEND ME AN EMAIL. If you don’t email me, I can’t fix the issue. You can send an email directly from your phone. At the bottom of the application listing on the Android Market, there is a button for “Send email to developer”. Click that, choose your email, then send me an email.
Features:
1. Uses both a widget and a normal application to turn on the LEDs as a flashlight.
2. The widget icon will change depending on whether the LEDs are on or not.
3. The application will allow you to configure whether you want the screen to dim or not.
4. The application will allow you to use the LEDs as a strobe light.
5. The application will allow you to use the LEDs as a MORSE CODE sender, implementing the international Morse protocol.
Version 2.2(11/26):
1. Strobe and Morse Code now run on their own threads. This means that there are now Start/Stop buttons.
2. Strobe now has 2 sliders that allow the duration and delay to be configurable. These can be moved while the strobe is on to see the values changed on the fly.
3. Changed the checkbox for the “Torch” section to be more descriptive.
I made tons of changes to how the settings are saved. I hope this will have fixed the issue with it losing the screen timeout. If it continues to happen, let me know.
Version 2.3(11/27):
1. Now supports landscape mode.
2. Added numeric labels to the strobe sliders.
Version 2.4(11/27):
1. Fixed issue with moving to/from landscape while Strobe or Morse Code was on.
Version 2.5(12/02):
1. Changed the Widget icon.
2. Added the ability to dim the screen while the LEDs are on. This includes having a slider to specify the brightness of the screen.
3. Fixed “B” “D” Morse Code bug.
4. The “Dim Screen” and “Turn Off Screen” are now disabled if Automatic Brightness is turned on. Automatic Brightness overrides both of these settings. Currently there is no way for me to disable Automatic Brightness programmatically. It seems to have been left out of the SDK.
Version 2.6(12/04):
1. The widget icon is now configurable. Use the MENU button in the application to select the icon for the widget.
2. Fixed issue where using the widget of certain other apps could cause the LEDs to come on.
3. Added a Disclaimer when opening the app. It should only be shown once. If you accept, it will not show again.
4. Added a message when Automatic Brightness is enabled.
5. The “Dim Screen” slider is disabled when the “Dim Screen” checkbox is unchecked.
Version 2.7(12/11):
1. Added HELP menu that will open to my website.
2. Changed the “Automatic Brightness” popup display only the first time.
3. Added option to turn on LEDs when the application opens. (Application Settings menu)
4. Moved “Torch” settings to menu. (Torch Settings menu)
Version 2.8(12/14):
1. Fixed issue where widget icon would get reset back to the default icon when exiting the application.
2. Added option to turn “Torch” off when exiting the application
NOTE: The Dim Screen only works from the application. It currently does not work from the widget. This is due to a bug in Android 2.0.
NOTE: If your screen brightens when you turn on the LEDs, then you have Automatic Brightness enabled, and it’s doing it’s job. It was designed to use light sensors to determine whether to dim or brighten the screen. The more light the sensors detect, the brighter the screen gets. I’ll let you take a guess where 1 of the 2 sensors are……directly beside the LEDs. So when you turn on the LEDs, the light causes the sensors to think it needs to brighten the screen.
NOTE: To change the widget icon, open the application, then hit the MENU button on the phone. This will bring up the menu in the application. Choose “Select Widget Icon”, then choose the icon you want to use.
NOTE: To install the widget, Long Press on an open space on a HOME screen, choose “Widgets”, then choose “MotoTorch LED”.
NOTE: For those that say that this application “starts in the background”, it does not. The application is not running. It’s the widget that is running in the background. This is what Android allows. The widget is running because it needs to constantly check to see if you have turned the LEDs on from the application so it can change it’s icon. This is allowed by Android, and is actually the default functionality of a widget.
I have created a Google Wave for MotoTorch LED. If you have Google Wave, you should be able to search for it and find it.
If you have “Barcode Scanner” or “ShopSavvy” installed on your Droid/Milestone, you can scan this QR-Code and it will take to you my app. You can scan it directly from your monitor.
I have also added a Donation version of the app to the Market. If you would like to donate toward MotoTorch’s development, you can buy that version. BOTH VERSIONS ARE EXACTLY THE SAME. The free version is NOT limited in any way.
You can also donate using Paypal.
Tags: Android, Droid, LED Flashlight, Milestone, Motorola Droid, MotoTorch LED

Posted on November 25th, 2009 at 8:16 PM
I noticed the Droid has a brighter flash than the app produces. Is there going to be an update to bring brighter light?
Posted on November 26th, 2009 at 7:35 PM
That is something that I am working on. I am trying to figure out what the camera application does differently to make the flash brighter.
Posted on November 26th, 2009 at 8:13 PM
Is your app open source?
Posted on November 27th, 2009 at 11:09 AM
It’s not open source yet, but it eventually will be.
Posted on November 27th, 2009 at 8:52 PM
Google Market could not found this…
Posted on November 28th, 2009 at 10:04 AM
This is for Android 2.0 only. If you have an earlier version, you will not be able to find it. Also, if you are outside of the US, and you have an unlocked phone, it will not show up per Google’s policy changes regarding copy-protected applications and unlocked phones.
Posted on November 28th, 2009 at 1:09 PM
This application should now show up on unlocked phones in Europe.
Posted on December 2nd, 2009 at 10:28 AM
So is there any way to brighten the led
Posted on December 2nd, 2009 at 10:39 AM
Please bring back the old torch widget! The new one looks AWFUL! At least give us the option to choose
Posted on December 2nd, 2009 at 12:59 PM
I am currently working on the ability to let user’s choose the widget icon.
Posted on December 2nd, 2009 at 1:26 PM
Hi Ryan.
I mocked up another widget icon for you.
https://www.yousendit.com/download/MVNjek91Z2psamZIRGc9PQ
If you like, email me the pixel dimensions for the widget icon and I can create you several versions.
Posted on December 3rd, 2009 at 5:20 AM
Like the app. Hate the New widget icon
Posted on December 4th, 2009 at 5:36 PM
This is exactly the App I was trying to figure out how to make for my first app…beat me to it. Still, lots of good lessons wrapped up in it, any indication when your source might be made available, good to learn from. I just can’t figure out the LED without freaking out the camera.
Posted on December 5th, 2009 at 8:41 AM
is there a direct way to donate, many people here in Europe do not have Credit cards
so adding a DONATE button here (e.g. for Paypal) would be great
Posted on December 5th, 2009 at 12:09 PM
Ok, I have made a Paypal button. I don’t know how it will handle multiple currencies. I just used USD.
Posted on December 5th, 2009 at 7:19 PM
worked fine $5 for your work
Paypal just converts the currencies
$5 => 3.46€
thanks for your work I do appreciate it
Posted on December 5th, 2009 at 9:19 PM
thanks.
Posted on December 6th, 2009 at 5:08 PM
Great app. Like Martin, this was also the first thing I tried to do after picking up a Droid but I never could figure out how to light the LED. Any word on when it’s going open source?
Posted on December 7th, 2009 at 8:33 PM
just “bought” the app.
#1 – you r a rockstar for releasing this both “donate” and regular! This thread probably ain’t the place, but please spread the word to other developers if this ends up rewarding you reasonably well for the hours you put into the work. There are lots of us who share your values in this regard!!!!
#2 – the morse code is definitely off on my a855. maybe by a decimal! (10x)
#3 – is the thread on
http://androidforums.com/motorola-droid/20679-mototorch-led-2-0-released-free-3-days-4.html
a better place for us to go for “support” or is this just as good?
Posted on December 8th, 2009 at 12:03 PM
1. Thanks
2. Do you mean off as in wrong? If so, can you tell me what letter/phrase shows as wrong?
3. Either place is fine. I get an email each time somebody posts on the forum, and I monitor here for comments/questions.
Thanks for the support.
Posted on December 9th, 2009 at 10:20 PM
Useful and clever app. Thanks! Two comments:
First, I’m using a Droid, and every time I start the app, it tells me that I have automatic brightness enabled, blah, blah. Perhaps it would suffice to only show this message to the user once?
Second, I have a 2nd flashlight app (G1 style, which works by simply making your screen white and bright). I find both useful in different circumstances. Is it possible to add the LCD light functionality to your app, so I don’t need two flashlight apps?
Thanks again.
Posted on December 10th, 2009 at 9:38 AM
I have had another request about making the automatic brightness popup act the same as the disclaimer where you only have to acknowledge it first. I will be adding that in my next update.
I doubt I will be adding that LCD flashlight to my app.
Posted on December 18th, 2009 at 3:13 PM
I like all of the option settings, but cannot get the strobe, flashlight, nor Morse code functions to work on my Motorola Droid 2.0. The only function which seems to work is turn on/off LED. Am I doing something wrong? I downloaded an installed the apparently looking for a flashlight for really dark areas and Morse for emergency situations. Please help. Thank you in advance
Posted on December 20th, 2009 at 10:46 AM
Are you opening the application? or using the widget? The widget only controls the “flashlight”, while the application controls all three. You should be able to just push the button and it will work.
Posted on December 23rd, 2009 at 3:02 AM
Hi,
I am frustrated with the screen off issue.
Could you tell me which method you used to turn off the screen? any API except for setting the screen timeout within settings.system?
Thank you a lot.
Posted on December 23rd, 2009 at 4:04 AM
How do you get the video to have led while recording on the motorola droid?
Posted on December 23rd, 2009 at 10:23 AM
@Vivi Wu,
I use the Settings.System.setInt() to set the screen timeout. That’s how I turn the screen off. I don’t know of another way of doing it.
@Richard,
Simply turn on the “Torch”, then open the camera application. The Torch will stay on while other applications open.
Posted on December 24th, 2009 at 1:33 PM
Ryan,
I understand if you would like to keep it proprietary, but would you mind posting the API call you are using to turn on the LED in MotoTorch? I read some forum posts implying that originally you were using the FLASH_MODE_ON setting of the camera’s autofocus, but that someone had discovered another way (you had alluded to the NotificationManager). Would you mind posting the gist of what you ended up with?
Thanks,
Laron
Posted on January 1st, 2010 at 11:37 AM
Ok….I must be an idiot! I would love to get the flashlight app on my droid, but I can’t find where to download it. I would love to buy or donate ….. please help
Posted on January 4th, 2010 at 11:59 AM
I have added a QR code that will allow you to scan it and it will go to the MotoTorch entries on the Marketplace.
You will need “Barcode Scanner” or “ShopSavvy”, both are free. ShopSavvy works the best.
Simply scan the QR code, and ShopSavvy will do what the barcode tells it to do. In “Barcode Scanner”, you will need to click “Open browser” after the barcode is scanned.
Also, remember, this is for the Motorola Droid and Motorola Milestone phones ONLY. If you are using any other phone, I can not guarantee it to work. It also requires Android 2.0 or higher. So if you are using Android 1.5 or 1.6, the app will not show up in the Marketplace.
Posted on January 5th, 2010 at 11:37 PM
So… what are the chances that this will eventually be able to interpret the LED flashes that it sends, using the camera?
Posted on January 6th, 2010 at 12:31 PM
@Gryftir
That is a feature that is currently being worked on. It’s not a simple task, so it’s taking a long time.
Posted on January 7th, 2010 at 1:01 AM
Can this damage the led?
Great job
Pk
Posted on January 7th, 2010 at 11:09 AM
@Pablo
short answer… I don’t know.
long answer….it’s possible. I have no idea whether my application puts additional strain on the LEDs. LEDs normally have a life of about 50,000 hours. That means they are would have to leave them on constantly for 24 hours a day, 7 days a week, for more than 2 years.
I don’t worry about it. Sure it’s possible that it could damage the LEDs, but it’s also possible that a meteor will land on my head and kill me when I walk out of my house in the morning.
Posted on February 1st, 2010 at 6:15 PM
do you think you can give me the exact numerals for the strobe light so it can match the beat of any techno song?
Posted on February 2nd, 2010 at 9:48 AM
Your blog is so informative … ..I just bookmarked you….keep up the good work!!!!
Hey, I found your blog in a new directory of blogs. I dont know how your blog came up, must have been a typo, anyway cool blog, I bookmarked you.
-Robert Shumake Fifth Third
Posted on February 4th, 2010 at 12:58 AM
Nexus One pleeeeeeese……
Posted on February 4th, 2010 at 11:04 AM
I am unable to make MotoTorch LED work on the Nexus One. There is only one way of turning on the LEDs without initializing the camera. If it doesn’t work on other hardware, there isn’t anything I can do about it.
It’s because of the Nexus One hardware, not because of Android 2.1.
Posted on February 8th, 2010 at 12:54 AM
Works perfect when I need to take videos in dark or lower light places. Just turn on led and go to camera.
Posted on February 9th, 2010 at 10:15 AM
Would you be willing to share how you access the LED?
We develop Barcode Scanner and having the LED (not flash) on would help scanning. a user requested this: http://code.google.com/p/zxing/issues/detail?id=320
I’m not sure that ‘torch’ is the right parameter setting and we don’t have a phone with flash or LED to test on.
Thanks — Sean
Posted on February 10th, 2010 at 11:18 AM
@Sean
The “torch” setting may work on other phones, but it does not work on the Motorola Droid/Milestone as the phone does not support that flash mode. The phones would have to support that flash mode for it to be possible.
If you can send me an email to ryanalford843 at gmail dot com, I can tell you how I did it on the Droid/Milestone.
Posted on February 11th, 2010 at 7:21 PM
When MotoTorch is told to start the LED on boot and the orientation changes, the LED will start again. Otherwise, great app
Posted on February 13th, 2010 at 2:07 PM
Thanks Patrick. I believe I saw your review on the Market, and tested it out and it happens for me also. As long as I can make it happen, I can fix it. I will be fixing this in my next release.
Posted on February 18th, 2010 at 12:32 PM
Will There be support for the Samsung moment in future updates?
Posted on February 18th, 2010 at 1:01 PM
@Ryan
Can you send me an email to ryanalford843 at gmail dot com? I have a test app that I would like to test on the Samsung Moment.
Posted on February 22nd, 2010 at 3:19 AM
Love the application but would like to see it work with camera and video record so that you can turn it on an then turn the camera application on and see your subject in the dark before using flash.
Posted on February 28th, 2010 at 8:46 PM
Hi!
I tried all “torch”-like apps and yours is the best!
I habe two questions:
First, the dim function never works… also the “Turn off screen” never does. What do you mean by starting as application? maybe that’s what I am doing wrong. I use Milestone.
Secondly, I read in the specs that the milestone has a “Tricolor LED”. Does that mean it is possible to change the color of the flashlight? That would be sooo awsome!
Posted on March 1st, 2010 at 1:25 AM
Great app, I use it all the time, its a permanent home screen widget. thanks!
~sam
Posted on March 2nd, 2010 at 10:12 AM
@Chris
If you have your phone set to use Automatic Brightness, the options to dim the screen and turn the screen off will not work. Automatic Brightness overrides any changes that I make to the device’s settings.