|
|
| (5 intermediate revisions by 3 users not shown) |
| Line 1: |
Line 1: |
| [http://news.engin.brown.edu/forums/thread-view.asp?tid=221 free cool ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=213 polyphonic ringtones] [http://wc1.worldcrossing.com/WebX/.1de609f4 free mono ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=106&forum=13 hydrocodone online] [http://wc1.worldcrossing.com/WebX/.1de609db cheap adipex] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=84&forum=13 free alltel ringtones] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=334 valium online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=146&forum=13 tenuate online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=128&forum=13 phentermine online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=85&forum=13 cheap alprazolam] [http://wc1.worldcrossing.com/WebX/.1de60a1e flexeril online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=196 hgh online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=114&forum=13 meridia] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=150&forum=13 ultram online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=201 free free ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=103&forum=13 funny ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=194 diethylpropion online] [http://wc1.worldcrossing.com/WebX/.1de609fe free qwest ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=207 real ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=186 lipitor online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=149&forum=13 ultracet online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=148&forum=13 order tramadol] [http://news.engin.brown.edu/forums/thread-view.asp?tid=159 cheap cialis] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=142&forum=13 sony ericsson ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=203 funny ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a32 online zoloft] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=120&forum=13 music ringtones] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=336 carisoprodol online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=160&forum=13 cheap zanaflex] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=354 free nokia ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=113&forum=13 lortab] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=362 free motorola ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=209 free samsung ringtones] [http://wc1.worldcrossing.com/WebX/.1de609dd free alltel ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=222 free sharp ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a28 cheap soma] [http://wc1.worldcrossing.com/WebX/.1de60a1a free mtv ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=109&forum=13 levitra online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=127&forum=13 cheap pharmacy online] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=361 free real ringtones] [http://wc1.worldcrossing.com/WebX/.1de609df cheap ambien] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=98&forum=13 diethylpropion online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=158&forum=13 cheap xanax] [http://news.engin.brown.edu/forums/thread-view.asp?tid=172 lorazepam] [http://wc1.worldcrossing.com/WebX/.1de609ff real ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=220 punk ringtones] [http://wc1.worldcrossing.com/WebX/.1de609dc albuterol online] [http://wc1.worldcrossing.com/WebX/.1de60a2e cheap xanax] [http://news.engin.brown.edu/forums/thread-view.asp?tid=156 fioricet online] [http://wc1.worldcrossing.com/WebX/.1de60a10 cheap didrex] [http://wc1.worldcrossing.com/WebX/.1de60a35 verizon ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=176 buy ultracet] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=356 tracfone ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=92&forum=13 cheap clomid] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=344 ativan] [http://news.engin.brown.edu/forums/thread-view.asp?tid=155 xanax online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=178 nexium online] [http://wc1.worldcrossing.com/WebX/.1de60a04 free sonyericsson ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=182 cheap clomid] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=82&forum=13 adipex online] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=343 online cialis] [http://news.engin.brown.edu/forums/thread-view.asp?tid=170 cheap hydrocodone] [http://news.engin.brown.edu/forums/thread-view.asp?tid=169 cheap levitra] [http://wc1.worldcrossing.com/WebX/.1de609f3 midi ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=111&forum=13 lisinopril online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=224 free wwe ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=153 cheap phentermine] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=147&forum=13 tracfone ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=181 sildenafil online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=212 verizon ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=223 free midi ringtones] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=335 phentermine online] [http://wc1.worldcrossing.com/WebX/.1de60a00 cheap rivotril] [http://wc1.worldcrossing.com/WebX/.1de60a0a vicodin online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=187 celexa online] [http://wc1.worldcrossing.com/WebX/.1de609eb free funny ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=197 cheap flexeril] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=105&forum=13 cheap hoodia] [http://news.engin.brown.edu/forums/thread-view.asp?tid=188 cheap tenuate] [http://news.engin.brown.edu/forums/thread-view.asp?tid=180 prozac online] [http://wc1.worldcrossing.com/WebX/.1de60a05 sprint ringtones] [http://wc1.worldcrossing.com/WebX/.1de609f9 cheap norco] [http://wc1.worldcrossing.com/WebX/.1de609f2 meridia online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=145&forum=13 free sprint ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=96&forum=13 buy diazepam] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=338 online fioricet] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=358 free mp3 ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a21 buy paxil] [http://wc1.worldcrossing.com/WebX/.1de60a31 buy zanaflex] [http://wc1.worldcrossing.com/WebX/.1de609de but alprazolam] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=141&forum=13 soma online] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=342 order diazepam] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=157&forum=13 wwe ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=161&forum=13 but zoloft] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=112&forum=13 buy lorazepam] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=124&forum=13 norco online] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=355 free ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=88&forum=13 cheap carisoprodol] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=360 free qwest ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=167 cheap clonazepam] [http://wc1.worldcrossing.com/WebX/.1de60a0e celexa online] [http://wc1.worldcrossing.com/WebX/.1de609e4 cheap clonazepam] [http://wc1.worldcrossing.com/WebX/.1de60a17 buy lipitor] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=123&forum=13 free nokia ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=184 lisinopril online] [http://wc1.worldcrossing.com/WebX/.1de60a24 propecia online] [http://wc1.worldcrossing.com/WebX/.1de609f8 nokia ringtones] [http://wc1.worldcrossing.com/WebX/.1de609fd punk ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=154 carisoprodol online] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=339 ultram online] [http://wc1.worldcrossing.com/WebX/.1de60a34 free sony ericsson ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=202 free tracfone ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=199 zyban online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=198 cheap hoodia] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=332 order tramadol] [http://wc1.worldcrossing.com/WebX/.1de60a1d free cingular ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=107&forum=13 free jazz ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=219 free alltel ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=101&forum=13 flexeril] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=359 nextel ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a15 free kyocera ringtones] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=363 samsung ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=117&forum=13 motorola ringtones] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=346 meridia online] [http://wc1.worldcrossing.com/WebX/.1de60a30 cheap xenical] [http://wc1.worldcrossing.com/WebX/.1de60a03 free sony ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=168 paxil online] [http://wc1.worldcrossing.com/WebX/.1de60a01 free sagem ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=160 ativan online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=136&forum=13 cheap rivotril] [http://wc1.worldcrossing.com/WebX/.1de609fb ortho online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=89&forum=13 celexa online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=139&forum=13 free sharp ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=163 cheap adipex] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=125&forum=13 cheap ortho] [http://wc1.worldcrossing.com/WebX/.1de609ee but hydrocodone] [http://news.engin.brown.edu/forums/thread-view.asp?tid=177 cheap propecia] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=91&forum=13 free cingular ringtones] [http://wc1.worldcrossing.com/WebX/.1de609f7 free nextel ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=215 sagem ringtones] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=347 online adipex] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=132&forum=13 free punk ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=97&forum=13 didrex online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=144&forum=13 sonyericsson ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=179 didrex online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=158 diazepam online] [http://wc1.worldcrossing.com/WebX/.1de60a25 samsung ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a26 free sharp ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=162 order meridia] [http://news.engin.brown.edu/forums/thread-view.asp?tid=217 mono ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=152 cheap valium] [http://wc1.worldcrossing.com/WebX/.1de609ec hgh online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=205 free nextel ringtones] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=357 free funny ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=191 cheap lortab] [http://wc1.worldcrossing.com/WebX/.1de60a2b ultracet] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=153&forum=13 viagra online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=183 albuterol online] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=349 vicodin online] [http://wc1.worldcrossing.com/WebX/.1de60a18 free motorola ringtones] [http://wc1.worldcrossing.com/WebX/.1de609f0 lorazepam online] [http://wc1.worldcrossing.com/WebX/.1de60a12 ericsson ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a19 free mp3 ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=216 free sonyericsson ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=161 viagra online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=95&forum=13 cheap cyclobenzaprine] [http://news.engin.brown.edu/forums/thread-view.asp?tid=192 but vigrx] [http://wc1.worldcrossing.com/WebX/.1de60a0d wwe ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=185 zoloft online] [http://wc1.worldcrossing.com/WebX/.1de609e3 cheap clomid] [http://wc1.worldcrossing.com/WebX/.1de60a13 order fioricet] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=138&forum=13 samsung ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=83&forum=13 albuterol online] [http://wc1.worldcrossing.com/WebX/.1de60a29 tramadol online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=173 xenical online] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=350 online alprazolam] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=93&forum=13 cheap clonazepam] [http://news.engin.brown.edu/forums/thread-view.asp?tid=204 free mp3 ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=164 norco online] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=337 online xanax] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=119&forum=13 free mtv ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=206 qwest ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=151&forum=13 valium online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=140&forum=13 sildenafil online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=162&forum=13 zyban online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=166 cheap alprazolam] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=353 levitra] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=333 cheap soma] [http://news.engin.brown.edu/forums/thread-view.asp?tid=189 ortho online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=159&forum=13 xenical online] [http://wc1.worldcrossing.com/WebX/.1de60a36 cheap zyban] [http://wc1.worldcrossing.com/WebX/.1de60a23 free polyphonic ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=208 motorola ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a1f lisinopril online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=137&forum=13 sagem ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a1b music ringtones] [http://wc1.worldcrossing.com/WebX/.1de609e0 ativan online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=229 jazz ringtones] [http://wc1.worldcrossing.com/WebX/.1de609e5 cool ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=99&forum=13 free ericsson ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic
| | == Zombie Detector == |
| | |
| | === Setup === |
| | |
| | # Create a new J2ME Midlet Suite in Eclipse by right-clicking in the Package Manager, selecting New -> Project -> J2ME Midlet Suite |
| | # Call this ZombieDetector. Leave everything else as is. |
| | # Right-click on your ZombieDetector project and select New -> Class |
| | # Use '''src''' as your package and '''ZombieDetector''' as the class name. Click Finish. |
| | # Open your new ZombieDetector class |
| | # Cut and paste the code from below into your file. Save. |
| | # Open up the ZombieDetector.jad file |
| | # Click on the Midlets tab. Click Add. |
| | # Write in ZombieDetector as the MIDlet name. |
| | # Click in the button that appears in class. You may have to start typing Zombie in. It should find your class automatically. If nothing happens, try closing all the files down and opening them again. |
| | # Right-click your project again, select Run As, then Run... |
| | # Setup so that it looks something like this - http://uberthings.com/teaching/mobile_application_design/2/run_dialog.png |
| | # Run your MIDlet |
| | |
| | <pre>/** |
| | * Simple Zombie Detector by Michael Sharon |
| | * |
| | * This program will allow a user to type in a sentence and detect if they are a zombie or not. |
| | */ |
| | |
| | //import relevant libraries |
| | import javax.microedition.midlet.*; |
| | import javax.microedition.lcdui.*; |
| | |
| | public class ZombieDetector extends MIDlet implements CommandListener { |
| | |
| | //contains a reference to the display |
| | private Display mDisplay; |
| | |
| | //these are the commands that we will use |
| | private Command mExitCommand, mDetectCommand, mCancelCommand; |
| | |
| | //high level user interface classes |
| | private TextBox mSubmitBox; |
| | |
| | //constructor |
| | public ZombieDetector() { |
| | |
| | //create the commands that we'll be using |
| | mExitCommand = new Command("Exit", Command.EXIT, 0); |
| | mDetectCommand = new Command("Detect", Command.SCREEN, 0); |
| | mCancelCommand = new Command("Cancel", Command.CANCEL, 0); |
| | |
| | //create the textbox that we'll be using |
| | mSubmitBox = new TextBox("Zombie Detector", "Am I a Zombie?", 64, 0); |
| | mSubmitBox.addCommand(mExitCommand); |
| | mSubmitBox.addCommand(mDetectCommand); |
| | mSubmitBox.setCommandListener(this); |
| | } |
| | |
| | //startApp is the very first thing run after the constructure |
| | public void startApp() { |
| | //get a reference to the current display - usually the first thing you do |
| | mDisplay = Display.getDisplay(this); |
| | |
| | //display the submit screen |
| | mDisplay.setCurrent(mSubmitBox); |
| | } |
| | |
| | //handles the MIDlet's paused state |
| | public void pauseApp() {} |
| | |
| | //cleans up when the MIDlet is destroyed |
| | public void destroyApp(boolean unconditional) {} |
| | |
| | //This gets called whenever we select a command |
| | public void commandAction(Command c, Displayable s) { |
| | if (c == mExitCommand) { |
| | destroyApp(false); |
| | notifyDestroyed(); |
| | } |
| | else if (c == mDetectCommand) { |
| | //start searching for zombies |
| | zombieSearch(); |
| | } |
| | } |
| | |
| | //The function which searches for zombies at the phone |
| | public void zombieSearch() { |
| | String word = mSubmitBox.getString(); |
| | String isZombie = null; |
| | int zombieCheck = 0; |
| | |
| | //Check if we're dealing with a zombie |
| | zombieCheck = word.indexOf("brains"); |
| | |
| | //See API docs for String.indexOf |
| | if (zombieCheck == -1) |
| | { |
| | isZombie = "This is a live one. No zombies here."; |
| | } |
| | else |
| | { |
| | isZombie = "Eeek! Run for your lives!"; |
| | } |
| | |
| | //Create a new alert |
| | Alert results = new Alert("Definition", isZombie,null, null); |
| | results.setTimeout(Alert.FOREVER); |
| | |
| | //Display the alert, then the submit field again |
| | mDisplay.setCurrent(results, mSubmitBox); |
| | } |
| | |
| | } |
Zombie Detector
Setup
- Create a new J2ME Midlet Suite in Eclipse by right-clicking in the Package Manager, selecting New -> Project -> J2ME Midlet Suite
- Call this ZombieDetector. Leave everything else as is.
- Right-click on your ZombieDetector project and select New -> Class
- Use src as your package and ZombieDetector as the class name. Click Finish.
- Open your new ZombieDetector class
- Cut and paste the code from below into your file. Save.
- Open up the ZombieDetector.jad file
- Click on the Midlets tab. Click Add.
- Write in ZombieDetector as the MIDlet name.
- Click in the button that appears in class. You may have to start typing Zombie in. It should find your class automatically. If nothing happens, try closing all the files down and opening them again.
- Right-click your project again, select Run As, then Run...
- Setup so that it looks something like this -

- Run your MIDlet
/**
* Simple Zombie Detector by Michael Sharon
*
* This program will allow a user to type in a sentence and detect if they are a zombie or not.
*/
//import relevant libraries
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class ZombieDetector extends MIDlet implements CommandListener {
//contains a reference to the display
private Display mDisplay;
//these are the commands that we will use
private Command mExitCommand, mDetectCommand, mCancelCommand;
//high level user interface classes
private TextBox mSubmitBox;
//constructor
public ZombieDetector() {
//create the commands that we'll be using
mExitCommand = new Command("Exit", Command.EXIT, 0);
mDetectCommand = new Command("Detect", Command.SCREEN, 0);
mCancelCommand = new Command("Cancel", Command.CANCEL, 0);
//create the textbox that we'll be using
mSubmitBox = new TextBox("Zombie Detector", "Am I a Zombie?", 64, 0);
mSubmitBox.addCommand(mExitCommand);
mSubmitBox.addCommand(mDetectCommand);
mSubmitBox.setCommandListener(this);
}
//startApp is the very first thing run after the constructure
public void startApp() {
//get a reference to the current display - usually the first thing you do
mDisplay = Display.getDisplay(this);
//display the submit screen
mDisplay.setCurrent(mSubmitBox);
}
//handles the MIDlet's paused state
public void pauseApp() {}
//cleans up when the MIDlet is destroyed
public void destroyApp(boolean unconditional) {}
//This gets called whenever we select a command
public void commandAction(Command c, Displayable s) {
if (c == mExitCommand) {
destroyApp(false);
notifyDestroyed();
}
else if (c == mDetectCommand) {
//start searching for zombies
zombieSearch();
}
}
//The function which searches for zombies at the phone
public void zombieSearch() {
String word = mSubmitBox.getString();
String isZombie = null;
int zombieCheck = 0;
//Check if we're dealing with a zombie
zombieCheck = word.indexOf("brains");
//See API docs for String.indexOf
if (zombieCheck == -1)
{
isZombie = "This is a live one. No zombies here.";
}
else
{
isZombie = "Eeek! Run for your lives!";
}
//Create a new alert
Alert results = new Alert("Definition", isZombie,null, null);
results.setTimeout(Alert.FOREVER);
//Display the alert, then the submit field again
mDisplay.setCurrent(results, mSubmitBox);
}
}