FORUMS
Remove All Ads from XDA

Titan Flashlight Application

24 posts
Thanks Meter: 0
 
By nilisco, Junior Member on 19th July 2007, 11:34 PM
Thread Deleted Email Thread
Here's a release of a simple flashlight application I created for the mogul based on code Vijay was kind enough to release a while back. Launch the exe once to turn on the camera light, launch it again to disable.

That's the only feature! I've messaged vijay with the value he needs to update his application with mogul support, so I hope he'll do that in the future if he has time. But until then, I whipped up this.

It might be buggy and it isn't quite the fastest application out there (I wish I knew how to query the camera for the current status of the LED) but it's a neat little tech demo that someone might find useful. I'll post the source code later after I have a chance to clean it up.

Report back with any problems as I've only tested this on my device! (Sprint Mogul)

Also, here's the obligatory "this program could possible harm your device and I take no responsibility for such an event." Use with caution and I wouldn't recommend leaving this on for long periods of time.

I'm using it with AEBPlus and have it bound to my camera key.
Attached Files
File Type: zip Flashlight.zip - [Click for QR Code] (36.9 KB, 2297 views)
20th July 2007, 01:34 AM |#2  
Senior Member
Flag St Louis
Thanks Meter: 64
 
More
GREAT WORK! ya i know.... the reason i made the script is 1 for a safety catch and 2 for ikandy...

the script will turn the light on for 30 sec and hten off... 60 sec the off.. or let u do it manually... i personally know i hit buttons sometimes so i set my side button to the 30 sec script...

heres the beta script the icons dont work perfect yet but hell for those of u who cant wait let me introduce... Flashlight by Nilisco WoW and Stroths

**THIS NO LONGER NEEDS MORTSCRIPT!**
Attached Files
File Type: cab Nilisco Flashlight.cab - [Click for QR Code] (297.4 KB, 1937 views)
20th July 2007, 03:14 AM |#3  
Senior Member
Thanks Meter: 11
 
More
ahhhh we have been waiting for this one...good work guys, can't wait to get this tested!
20th July 2007, 03:46 AM |#4  
Senior Member
Flag St Louis
Thanks Meter: 64
 
More
Quote:
Originally Posted by daclothe

ahhhh we have been waiting for this one...good work guys, can't wait to get this tested!

thanks but dont give me the credit ... this one is ALL Nilisco :)
20th July 2007, 02:35 PM |#5  
Junior Member
Thanks Meter: 0
 
More
anyone know how to add a icon to it, so when it shows up on my quicklaunch for the HTC home tab, it has a pretty little icon?
21st July 2007, 04:14 AM |#6  
Senior Member
Flag St Louis
Thanks Meter: 64
 
More
cab updated .... mortscript no longer needed
21st July 2007, 06:22 PM |#7  
OP Junior Member
Thanks Meter: 0
 
More
Vijay's code was the key:

Code:
void fn_FlashMode(int Mode_int)
{
	HANDLE CamHandle;

	//1=on
	//2=off
	//DWORD FlashMode=1;

	//open camera
	CamHandle = CreateFile(TEXT("CIF1:"), GENERIC_READ, 0, NULL, 3, 0, NULL); 

	//Mogul specific device io
	DWORD a=0x90002014;

	DeviceIoControl(CamHandle, a, LPVOID(&Mode_int), sizeof(Mode_int), 0, NULL, NULL, NULL); 

	CloseHandle(CamHandle);
}
The only challenge in getting the flashlight working was to find the mogul io, which was right in the htc camera dll. The only way developers can communicate with it (I believe) is the DeviceIoControl win32 function, which is abstracted into functions in the camera dll. So, you just disassemble the driver dll, look for a DeviceIoControl command that looks to have something to do with flash, and bam, you've found the IO as it's a parameter in the function.


I didn't bother with the rest of my code (mainly just win32 registry changes to keep track if the light was on or off) as I believe my program will become a bit outdated as soon as someone posts the VJCandela hack they did without his permission.
22nd July 2007, 05:33 PM |#8  
Junior Member
Thanks Meter: 0
 
More
I like this a lot. Also I'm impressed with the brightness of the moguls flash.
25th July 2007, 01:03 AM |#9  
Junior Member
Thanks Meter: 0
 
More
This works great. Any chance of making a version that stays on only if I am holding the specified button?

Vijay had one of his apps that I could assign to my left side 'press and hold' voice dial key. It would only stay on if I held it down and would also turn off after 15 secs of being held.

The current one works, but I am afraid of it staying on, and would also prefer it to turn off sooner when I am done with it.

So far so good though!
25th July 2007, 10:56 PM |#10  
Dishe's Avatar
Senior Member
Thanks Meter: 157
 
More
This is awesome!

I like the icons too!

Speaking of device-specific code, has anyone considered writing some code to re-route the audio to the internal handset speaker versus the external amplified one?

There are times that I think it would be useful to have audio coming through the handset... like if I want to play back voice recordings for only me to hear (vs the whole world when I play it out loud), or for VOIP apps like Skype. Right now, most voip apps use the outer loud speaker because every device accesses the internal one differently (or so they say).
This is quite a bit more complicated than a flashlite app, but there aren't enough Titan-specific developers yet to ask this anywhere else!

Figured I'd get your thoughts on this idea... what do you think it would take to write a small app to toggle the direction of audio?
27th July 2007, 04:21 PM |#11  
kmartburrito's Avatar
Senior Member
Flag Denver, CO
Thanks Meter: 50
 
More
Quote:
Originally Posted by wowthatisrandom

GREAT WORK! ya i know.... the reason i made the script is 1 for a safety catch and 2 for ikandy...

the script will turn the light on for 30 sec and hten off... 60 sec the off.. or let u do it manually... i personally know i hit buttons sometimes so i set my side button to the 30 sec script...

heres the beta script the icons dont work perfect yet but hell for those of u who cant wait let me introduce... Flashlight by Nilisco WoW and Stroths

**THIS NO LONGER NEEDS MORTSCRIPT!**

Just an FYI, my corporate antivirus picked this file up as a Trojan. Has anyone else noticed this?
Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes