A cellphone or pager application written in the Java 2 Platform, Micro Edition version (J2ME). See MIDP and J2ME.
Download Computer Desktop Encyclopedia to your iPhone/iTouch
| 5min Related Video: MIDlet |
| Wikipedia: MIDlet |
| This article includes a list of references, related reading or external links, but its sources remain unclear because it lacks inline citations. Please improve this article by introducing more precise citations where appropriate. (July 2007) |
A MIDlet is a Java application framework for the Mobile Information Device Profile (MIDP) that is typically implemented on a Java-enabled cell phone or other embedded device or emulator. MIDlets are applications, such as games.
MIDlet distributions main file is a .jar file, but MIDlet distributions can also consist of a .jad file containing the location of and describing the contents of the .jar file. The implementation of a MIDlet may or may not require the presence of a .jad file.
A MIDlet has to fulfill the following requirements in order to run on a mobile phone:
Unlike a Java applet, a MIDlet is limited to use of the LCDUI rather than the more familiar widgets of AWT and Swing. There are many other aspects of the MIDP platform that MIDlet programmers must take into account.
import javax.microedition.midlet.MIDlet; import javax.microedition.lcdui.*; public class CalendarControl extends MIDlet implements CommandListener { private Display display; private Display display2; private TextField userName; private TextField password; private Form form; private Form form2; private Command cancel; private Command login; private Command next; private ChoiceGroup technology; public CalendarControl() { userName = new TextField("LoginID:", "", 10, TextField.ANY); password = new TextField("Password:", "", 10, TextField.PASSWORD); form = new Form("Sign in"); form2 = new Form("App Form"); cancel = new Command("Cancel", Command.CANCEL, 2); login = new Command("Login", Command.OK, 2); next =new Command("Next", Command.OK,2); technology = new ChoiceGroup("Select Technology Which You Know", Choice.MULTIPLE); } public void startApp() { display = Display.getDisplay(this); form.append(userName); form.append(password); form.addCommand(cancel); form.addCommand(login); form.setCommandListener(this); display.setCurrent(form); } public void pauseApp() { } public void destroyApp(boolean unconditional) { notifyDestroyed(); } public void validateUser(String name, String password) { if (name.equals("qm") && password.equals("j2")) { menu(); } else { tryAgain(); } } public void menu() { display = Display.getDisplay(this); technology.append("JAVA", null); technology.append("J2ME", null); technology.append("J2EE", null); technology.append("JSF", null); form2.addCommand(next); form2.append(technology); display.setCurrent(form2); } public void showMenu(){ } public void tryAgain() { Alert error = new Alert("Login Incorrect", "Please try again", null, AlertType.ERROR); error.setTimeout(Alert.FOREVER); userName.setString(""); password.setString(""); display.setCurrent(error, form); } public void commandAction(Command c, Displayable d) { String label = c.getLabel(); if(label.equals("Cancel")) { destroyApp(true); } else if(label.equals("Login")) { validateUser(userName.getString(), password.getString()); } } }
|
|||||||||||||||||||||||||
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)
| applet (technology) | |
| J2ME (technology) | |
| Mobile BASIC |
| How do you run midlet program? Read answer... |
| How could you add background image to J2ME midlet form? | |
| Can i use more than one MIDlet in a project? | |
| How can you get java midlet application to your nokia phone? |
Copyrights:
![]() | Computer Desktop Encyclopedia. THIS DEFINITION IS FOR PERSONAL USE ONLY. All other reproduction is strictly prohibited without permission from the publisher. © 1981-2010 The Computer Language Company Inc. All rights reserved. Read more | |
![]() | Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "MIDlet". Read more |
Mentioned in