Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 12 lcdui Rob Pooley

Slides:



Advertisements
Similar presentations
MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee.
Advertisements

J2ME Form Nesneleri Melih Sakarya. Form Nesnesi Form form= new Form("Giris"); display.setCurrent(form);
J2ME Screen Hierarchy Displayable ScreenCanvas FormAlertListTextbox.
 User Interface - Raeha Sandalwala.  Introduction to UI  Layouts  UI Controls  Menus and ‘Toasts’  Notifications  Other interesting UIs ◦ ListView.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Developing Software for Wireless Devices
Chapter Day 10. © 2007 Pearson Addison-Wesley. All rights reserved4-2 Agenda Day 10 Questions from last Class?? Problem set 2 posted  10 programs from.
Making Cell Phone Games An Overview Ray Ratelis Guild Software, Inc.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
Cosc 4755 Phone programming: GUI Concepts & Threads.
Developing J2ME Applications Mobile and Wireless Networks.
© 2009 Research In Motion Limited User interface design for mobile devices.
Java 2 Platform, Micro Edition (J2ME) By Xiaorong Wang.
Detecting Changes  ItemStateListener interface – detect changes in internal state of an Item  new selection made in a ChoiceGroup  adjusted value of.
Chapter Day 9. © 2007 Pearson Addison-Wesley. All rights reserved4-2 Agenda Day 8 Questions from last Class?? Problem set 2 posted  10 programs from.
By: Jeremy Smith.  Introduction  Droid Draw  Add XML file  Layouts  LinearLayout  RelativeLayout  Objects  Notifications  Toast  Status Bar.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 19 Microsoft’s Approach 1 –.NET Mobile Framework part 2 Rob.
PROG Mobile Java Application Development PROG Mobile Java Application Development Event Handling Creating Menus.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 12 Using the KToolbar Rob Pooley
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
MintTrack By Jeff Titus Christopher C. Wilkins Stephen Krach Pablo BajoLaso.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Computer Science Wi-Fi App using J2ME and MVC Architecture Advisor : Dr. Chung-E Wang Department of Computer Science Sacramento State University Date:
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
Designing Interface Components. Components Navigation components - the user uses these components to give instructions. Input – Components that are used.
Spong Bluetooth game Developed by: Erik Matzols Fredrik Lindberg.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 13 lcdui and OXO Rob Pooley
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 14 Various MIDlet examples Rob Pooley
Fundamentals of GUI Programming. Objectives: At the end of the session, you should be able to: describe the guidelines that are used for creating user-friendly.
Ch 3-4: GUI Basics Java Software Solutions Foundations of Program Design Sixth Edition by Lewis & Loftus Coming up: GUI Components.
Field Trip #19 Animations with Java By Keith Lynn.
Field Trip #32 Digital Alarm Clock By Keith Lynn.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Graphical User Interfaces (Part 2) 1. View  view  presents the user with a sensory (visual, audio, haptic) representation of the model state  a user.
CS324e - Elements of Graphics and Visualization Java GUIs - Event Handling.
Object Oriented Programming.  Interface  Event Handling.
May 12, 1998CS102-01Lecture 7-3 Building GUIs in Java I CS Lecture 7-3 A picture's worth a thousand words.
Oct 021 Outline What is a widget? Buttons Combo boxes Text components Message boxes.
EGR 115 Introduction to Computing for Engineers
1 Introduction to J2ME Outline MIDP Building J2ME Apps- Tool J2ME Wireless Toolkit Demo MIDlet Programming -- MIDlet Transition States -- Midlet Skeleton.
MATLAB and SimulinkLecture 61 To days Outline Graphical User Interface (GUI) Exercise on this days topics.
View  view  presents the user with a sensory (visual, audio, haptic) representation of the model state  a user interface element (the user interface.
Events. Slide 2©SoftMoore Consulting Events Events are generated when a user interacts with the view objects of an application. Examples –button clicked–
12-Jun-16 Event loops. 2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output.
CHAPTER 6 Threads, Handlers, and Programmatic Movement.
CSE403: MIDlets and Ant1 MIDlets and Ant April 3, 2003 Shane Cantrell Zach Crisman.
Advance Computer Programming Market for Java ME The Java ME Platform – Java 2 Micro Edition (J2ME) combines a resource- constrained JVM and a set of Java.
1 Mobile Application Development Framework 4/16/2009 Richard Yang.
Java N Amanquah.
Introduction to Event-Driven Programming
Lecture 8: Graphics By: Eliav Menachi.
Mobile Application Development BSCS-7 Lecture # 8
Event loops 16-Jun-18.
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
Chap 7. Building Java Graphical User Interfaces
Graphical User Interfaces -- Introduction
The structure of Interactive Software
Introduction to Computing Using Java
AWT Components and Containers
Event loops.
Event loops 17-Jan-19.
Event loops 17-Jan-19.
Event loops 8-Apr-19.
Lecture 8: Graphics By: Eliav Menachi.
Event loops.
Event loops 19-Aug-19.
Presentation transcript:

Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 12 lcdui Rob Pooley

Programming Handheld and Mobile devices 2 The Screen The central abstraction of the MIDP’s UI is a screen. –A screen is an object that encapsulates device- specific graphics rendering user input. –Only one screen may be visible at a time, and the user can only traverse through the items on that screen. –The screen takes care of all events that occur as the user navigates in the screen, with only higher-level events being passed on to the application

Programming Handheld and Mobile devices 3 Categories of Screen There are three categories of screens: –Screens that encapsulate a complex user interface component (e.g., classes List or TextBox). The structure of these screens is predefined, and the application cannot add other components to these screens. –Generic screens (i.e., class Form) that the application can populate with text, images, and simple sets of related UI components. –Screens that are used in context of the low-level API (i.e., subclasses of class Canvas). Each screen, except the low-level Canvas, can attach a Ticker.

Programming Handheld and Mobile devices 4 Class Display The class Display acts as the display manager that is instantiated for each active MIDlet and provides methods to retrieve information about the device’s display capabilities. A Screen is made visible by calling the setCurrent() method of Display.

Programming Handheld and Mobile devices 5 Use of Screen types List is used when the user should select from a predefined set of choices. TextBox is used when asking textual input. Alert is used to display temporary messages containing text and images. A special class Form is defined for cases where screens with a predefined structure are not sufficient.

Programming Handheld and Mobile devices 6 Using Form Form is designed to contain a small number of closely related UI elements. These elements are the subclasses of Item: ImageItem, StringItem, TextField, ChoiceGroup, and Gauge. The classes ImageItem and StringItem are convenience classes that make certain operations with Form and Alert easier. If the components do not all fit on the screen, the implementation may either make the form scrollable or implement some components so that they can either popup in a new screen or expand when the user edits the element.

Programming Handheld and Mobile devices 7 Rules of use getDisplay() is callable from startApp() until destroyApp() is returned. The Display object is the same until destroyApp() is called. The Displayable object set by setCurrent() is not changed by the application manager.

Programming Handheld and Mobile devices 8 Roles of MIDlet functions startApp - The application may call setCurrent() for the first screen. –The application manager makes Displayable really visible when startApp() returns. –Note that startApp() can be called several times if pauseApp() is called in between. –This means that initialization should not take place, and the application should not accidentally switch to another screen with setCurrent(). pauseApp - The application may pause its threads. –Also, if starting with another screen when the application is re- activated, the new screen should be set with setCurrent(). destroyApp - The application may delete created objects

Programming Handheld and Mobile devices 9 Event handling There are four kinds of UI callbacks: Abstract commands that are part of the high-level API Low-level events that represent single key presses and releases (and pointer events, if a pointer is available) Calls to the paint() method of a Canvas class Calls to a Runnable object’s run() method requested by a call to callSerially() of class Display All UI callbacks are serialized, so they will never occur in parallel.

Programming Handheld and Mobile devices 10 Abstract Commands MIDP applications define Commands, and the implementation may manifest these via either abstract buttons, menus, or whatever mechanisms are appropriate for that device. Commands are installed to a Displayable (Canvas or Screen) with a method addCommand of class Displayable. The Command objects have three constructor parameters: –Label: Shown to the user as a hint. –CommandType: The meaning of the command. One often used hint would be BACK which causes the application to go back to a previous state. Most phone designs have standard policy on which button is used for this operation. The commandType hint allows the implementation to take advantage of that policy. –Priority: Provided to the implementation for better mapping to device capabilities.

Programming Handheld and Mobile devices 11 CommandListener The handling of events in the high-level API is based on a listener model. Screens and Canvases may have listeners for commands. –An object willing to be a listener should implement an interface CommandListener that has one method: void commandAction(Command c, Displayable d); There is also a listener interface for state changes of the Items in a Form. –The method void itemStateChanged(Item item); defined in interface ItemStateListener is called when the value of an interactive Gauge, ChoiceGroup, or TextField changes.

Programming Handheld and Mobile devices 12 Class Summary Interfaces Choice Choice defines an API for a user interface components implementing selection from predefined number of choices. CommandListener This interface is used by applications which need to receive high-level events from the implementation. ItemStateListener This interface is used by applications which need to receive events that indicate changes in the internal state of the interactive items within a Form screen. Classes Alert An alert is a screen that shows data to the user and waits for a certain period of time before proceeding to the next screen. AlertType The AlertType provides an indication of the nature of alerts. Canvas The Canvas class is a base class for writing applications that need to handle low-level events and to issue graphics calls for drawing to the display. ChoiceGroup A ChoiceGroup is a group of selectable elements intended to be placed within a Form. Command The Command class is a construct that encapsulates the semantic information of an action. DateField A DateField is an editable component for presenting date and time (calendar) information that may be placed into a Form. Display Display represents the manager of the display and input devices of the system. Displayable An object that has the capability of being placed on the display. Font The Font class represents fonts and font metrics. Form A Form is a Screen that contains an arbitrary mixture of items: images, read-only text fields, editable text fields, editable date fields, gauges, and choice groups. Gauge The Gauge class implements a bar graph display of a value intended for use in a form. Graphics Provides simple 2D geometric rendering capability. Image The Image class is used to hold graphical image data. ImageItem A class that provides layout control when Image objects are added to a Form or to an Alert. Item A superclass for components that can be added to a Form and Alert. List The List class is a Screen containing list of choices. Screen The common superclass of all high-level user interface classes. StringItem An item that can contain a string. TextBox The TextBox class is a Screen that allows the user to enter and edit text. TextField A TextField is an editable text component that may be placed into a Form. Ticker Implements a "ticker-tape," a piece of text that runs continuously across the display.