Two Minute Timer in mobile.processing
no system or programming language should be without it's 2 minute timer for all those GTD followers out there. so i made one in mobile.processing.
the programm starts a 120 sec countdown and sends the app in background. After 2 minutes the vibration alarm is activated for 1 second.
i made a qr-barcode that contains the link to the jad file. just point a qrcode reader like zxing to it and install it
you can also use the direct link https://www.local-guru.net/mobileprocessing/twominutetimer/midlet/twominutetimer.jad (but i think it is a bit complicated to enter on a mobile phone)
import processing.phone.; import javax.microedition.midlet.; import javax.microedition.lcdui.*; Phone p;
PFont font;
int mil;
Display display;
Displayable screen;
int wait = 2 * 60 * 1000;
void setup() {
display = Display.getDisplay(this);
screen = display.getCurrent();
p = new Phone(this);
font = loadFont(FACE_PROPORTIONAL, STYLE_PLAIN, SIZE_LARGE);
textFont(font);
textAlign(CENTER);
fill(0);
int mil = millis();
display.setCurrent(null);
}
void draw() {
background(255);
text( "" + (wait - (millis() - mil)), width/2, height/2);
if ( millis() - mil > wait ) {
display.setCurrent(screen);
p.vibrate(1000);
p.flash(1000);
}
if ( millis() - mil > wait + 1000 ) {
exit();
}
}
See also:
qr-code midlet installer
sketch experiment 7 - osc events
nested cubes in processing
processing phaseflower
Thanks for the useful script. I was searching something similar to this for quite a long time. Editing mobile.processing isn't an easy thing for me so you have helped me a lot. I will be waiting for more great articles from you in the nearest future. Thanks!