Steven,
Worked on this on and off all weekend (between Thanksgiving leftovers, of course
)...
It was a bit tricky, but I think I've got it (by George
).
Gotta polish a few things, but I hope to publish something to the Market (free, of course) still yet today.
The first version will be pretty basic:
1) when the app/service is launched, you'll press the "
Start Monitoring" button
2) the app will monitor the battery state to see what its charging state is
3) if charging, the LED will be turned
RED
4) if fully-charged, the LED will be
GREEN
5) if discharging, the LED will be turned OFF (although I tested using
BLUE, which was really cool, IMHO)
6) when done monitoring with the app, press the "
Stop Monitoring and Exit" button
Please note that the LED indicator
only lights-up when the screen is
off (I think everyone already knows this--this really made is wonky to test, btw).
Here's my punch-list for updates to this:
1) set your own polling interval (currently defaults to 10 seconds)
2) display the percent charged in the app (simple to do, but I didn't want to add the extra I/O in the first version or unless the user selected)
3) set your own LED state/color (or OFF) assignments
Also note, there's two things that make this Droid X-specific:
1) Its probably not needed for other phones since we know the X doesn't show the battery status via the LED indicator, but other phones do
2) The battery status file that I monitor is in a specific location that is not necessarily the same for other phones
More later... Cheers!