Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Timer;
- import javax.microedition.lcdui.ChoiceGroup;
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Display;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.lcdui.Form;
- import javax.microedition.lcdui.StringItem;
- import javax.microedition.lcdui.TextField;
- import javax.microedition.midlet.MIDlet;
- public class pinger extends MIDlet implements CommandListener
- {
- Display display;
- Form form;
- TextField host;
- TextField user;
- TextField pass;
- TextField admin;
- TextField interval;
- Command ok_Command;
- Command exit;
- Command stop;
- Timer timer;
- int vInterval;
- ChoiceGroup options;
- StringItem str;
- public void flash()
- {
- int int_1 = 0;
- for (; int_1 < 4; int_1++)
- {
- display.flashBacklight(250);
- }
- }
- public void mainScreen()
- {
- form.deleteAll();
- form.removeCommand(stop);
- form.append(host);
- form.append(user);
- form.append(pass);
- form.append(admin);
- form.append(interval);
- form.append(options);
- form.addCommand(exit);
- form.addCommand(ok_Command);
- form.setCommandListener(this);
- display.setCurrent(form);
- }
- public void ping()
- {
- form.deleteAll();
- form.append(str);
- form.removeCommand(ok_Command);
- form.addCommand(stop);
- timer = new Timer();
- pinger.task pinger$task_1 = new task();
- timer.schedule(pinger$task_1, (long) 0, (long) (1000 * Integer.parseInt(interval.getString())));
- }
- public void startApp()
- {
- display = Display.getDisplay(this);
- mainScreen();
- }
- public void pauseApp()
- {
- }
- public void destroyApp(boolean boolean_1)
- {
- notifyDestroyed();
- }
- public void commandAction(Command command_1, Displayable displayable_1)
- {
- String string_1 = command_1.getLabel();
- if (string_1.equals("Exit"))
- {
- destroyApp(true);
- }
- else if (string_1.equals("Stop"))
- {
- timer.cancel();
- mainScreen();
- }
- else if (string_1.equals("Ok"))
- {
- ping();
- }
- }
- public pinger()
- {
- form = new Form("Reloader");
- str = new StringItem("", "");
- vInterval = 40;
- options = new ChoiceGroup("Options", 2);
- options.append("Flash on alive", null);
- options.append("Vibrate on alive", null);
- host = new TextField("Server", "http://xxx.freevar.com/index.php", 150, 4);
- user = new TextField("User", "botname", 35, 4);
- pass = new TextField("Pass", "", 36, 4);
- admin = new TextField("Admin", "", 35, 4);
- interval = new TextField("Interval", "40", 5, 2);
- ok_Command = new Command("Ok", 4, 1);
- exit = new Command("Exit", 7, 3);
- stop = new Command("Stop", 4, 2);
- }
- // Warning! Inner class pinger$task not found!
- }
Add Comment
Please, Sign In to add comment