1 / 24

Writing GUIs for Handheld Devices

Writing GUIs for Handheld Devices. Mobile Information Device Profile (MIDP). Cell phone vs. PDA. Java devices. http://wireless.java.sun.com/device/ http://java.sun.com/products/midp. MIDP GUI classes. Alert Command

barton
Download Presentation

Writing GUIs for Handheld Devices

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Writing GUIs for Handheld Devices Mobile Information Device Profile (MIDP)

  2. Cell phone vs. PDA

  3. Java devices • http://wireless.java.sun.com/device/ • http://java.sun.com/products/midp

  4. MIDP GUI classes • Alert • Command • DateField • Display • Displayable • Form • Gauge • List • TextBox • TextField • Ticker • CommandListener

  5. Handheld screens • There can be several screens in an application, but only one screen at a time can be visible (or current) in a display, and the user can traverse only through the items on that screen

  6. Types of screens • A UI component • Forms • Graphics (canvas)

  7. Major MIDP Gui classes

  8. Screens • there are four types of high-level screens, shown by the subclasses: TextBox, List, Alert, and Form • Every Screen can have two additional characteristics: a title and a ticker. The screen title is simply a String that appears above the screen contents. The ticker is a graphical component that appears above the title and can be used to scroll information across to the user.

  9. The following methods of the Screen class can be used to set and retrieve the title and the ticker, respectively. • public void setTitle(String title); • public String getTitle( ); • public void setTicker(Ticker ticker); • public Ticker getTicker( );

  10. Types of MIDP GUI: • List and textboxs • The structure of these screens is predefined, and the application cannot add other components to these screens.

  11. Forms • The application can add text, images, and a simple set of related UI components to the form, which acts as a container.

  12. Screens used within the context of the low-level API, such as a subclass of the Canvas or Graphics class.

  13. “Ticker Tape” • The Ticker class implements a tickertape, or a piece of text that runs continuously across the display. A ticker can be attached: Alert, TextBox, List, and Form. To create a ticker object, use the Ticker constructor: • public Ticker(String str);

  14. Ticker Tape • There are a few points to note about a ticker: • No method calls are provided for starting and stopping the ticker. • The ticker string scrolls continuously. In other words, when the string finishes scrolling off the display, the ticker starts over at the beginning of the string. It may help to add some spaces at the end of the ticker string so the message ends do not appear tied together. • The direction and the speed of the scrolling are determined by the MIDP implementation

  15. TextBox • A TextBox object is a screen that allows the user to enter and edit text. You can use a TextBox if your MIDlet needs some kind of input such as a name, a phone number, an email address, or a password. To create a TextBox object, you need to specify four parameters, as shown in the TextBox's constructor: • public TextBox(String title, String text, int maxSize, int constraints);

  16. Alert • An alert is an ordinary screen that can contain text and an image. It informs the user about errors and other exceptional conditions. An alert can either be modal or timed.

  17. Modal alert • A modal alert remains on the screen until the user dismisses it, at which point it returns to either the screen that was displayed before it, or a screen specifically chosen by the application. This is useful if you require the user to make a choice. For example, you might display a message such as "Are you sure?"

  18. Timed alert • A timed alert, on the other hand, is displayed for a certain amount of time (typically a few seconds). It is useful for displaying an informative message that does not need to be acknowledged by the user. For example, you might want to display a message that says "Your message has been sent".

  19. Example of a timed out

  20. List • A list is a screen containing selectable choices. The user can interact with a list by moving from element to element. • Note that this high-level API interaction does not cause any programming events to be fired back to the application. That only occurs when a selection has been made.

  21. Example lists

  22. MIDP Style GuideMobile Information Device Profile (MIDP)1.0aAugust, 2002 http://java.sun.com/j2me/docs/alt-html/midp-style-guide7/index.html

  23. Mobile guidelines • People use phones and PDAs different than screen GUIs. Therefore, the UI should be SIMPLE as possible to use. • Entering aplhanumberic data through a handheld unit can be tedious. If possible, always use a list of choices. • MIDlets should query the size of the display and adjust to it.

  24. Project 3 • A cell phone interface will be provided. It will include buttons. • You will write a panel that will be added to the cell phone frame. • You will write button event handlers.

More Related