TorchLight

This idea struck me while using the newly brewed mirror application of mine.

Just the opposite of it, instead of a blackscreen and backlight off, I thought using a empty screen and blacklight on can turn the phone into a light source.

Another silly idea? Hopfully not. Lets say you might drop your car keys below the car seat where the door lights do not provide enough illumitation. Turn the torch light application on.

Then why not just press any button to turn the handphone lights on? 1) You dont have to keep pressing to keep on the lights on. 2) Its the clearest, bright light you can get from your phone lcd screen.

One day, when you find yourself in pitch darkness with nothing but your phone, you should find this application useful. Other uses for this software is reading papers in dim light conditions and … draining battery life..

[update]
At the end of the day after I wrote this version, I found while surfing the net that someone had implemented this idea too but for symbian series 60. See here

[note]
Download TorchLight.jar

I have also updated Mirror midlet so it can exit gracefully on Sony Ericsson phones. Both midlets now have icons.

[source]

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

import com.nokia.mid.ui.DeviceControl;
import com.nokia.mid.ui.FullCanvas;
/**
* Mirror Application for Nokia Phones - Turns Screen Black
*
* @author Joshua Koo http://zz85.is.dreaming.org zz85@users.sf.net
*
* 30 Jan 2006, Monday (Chinese New Year’s Day 2)
*/
public class TorchMIDlet extends MIDlet implements CommandListener {

private Canvas myCanvas;

public TorchMIDlet() {
}

public void startApp() throws MIDletStateChangeException {
myCanvas = new MyCanvas(this);
Display.getDisplay(this).setCurrent(myCanvas);
myCanvas.repaint();
DeviceControl.setLights(0, 100); //Turns on lights

//myCanvas.addCommand(new Command(”Exit”, Command.EXIT, 0));
//myCanvas.setCommandListener(this);
}

public void pauseApp() {
}

public void destroyApp(boolean arg0) throws MIDletStateChangeException {
}

public void commandAction(Command c, Displayable s) {
notifyDestroyed();
}

}

class MyCanvas extends FullCanvas {

int toFill = 0×999999; // white

MIDlet m;
public MyCanvas(MIDlet m){
super();
this.m = m;
}

public void paint(Graphics g) {
//g.setColor(toFill);
//g.fillRect(0,0,getWidth(),getHeight());
}

public void keyPressed(int keyCode)
{
if (keyCode == Canvas.UP)
toFill++;
if (keyCode == Canvas.DOWN)
toFill–;
if (keyCode == KEY_SOFTKEY1)
m.notifyDestroyed();

repaint();
}

}

0 Responses to “TorchLight”


  1. No Comments

Leave a Reply