Session5 J2ME High Level User Interface(HLUI) part1


Published on

Session5 J2ME High Level User Interface(HLUI) part1

  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Session5 J2ME High Level User Interface(HLUI) part1

  1. 1. Outline-session 5 (07-April-2009) <ul><li>>> High-Level User Interface: Part I </li></ul><ul><li>-Introduction </li></ul><ul><li>-Screen </li></ul><ul><li>- Form </li></ul><ul><li>-Item </li></ul><ul><li>-DateField </li></ul><ul><li>-Gauge </li></ul><ul><li>-StringItem </li></ul><ul><li>-TextField </li></ul><ul><li>-Choice and ChoiceGroup </li></ul><ul><li>-Image and Image Item </li></ul>
  2. 2. Introduction <ul><li>>>MIDP 2.0 UI interface class in two packages. </li></ul><ul><li>-- javax.microedition.lcdui </li></ul><ul><li> </li></ul><ul><li>>> lcdui stands for lliquid crystal display user interface </li></ul><ul><li>>>javax.microedition.lcdui package can be divided into two logical groups: </li></ul><ul><li>-- high-level group </li></ul><ul><li>--low -level groups </li></ul>
  3. 3. Introduction <ul><li>>>High level group </li></ul><ul><li>--high-level group are perfect for development of MIDlets that target the maximum number of devices </li></ul><ul><li>-- These classes do not provide exact control over their display </li></ul><ul><li>-- These classes are heavily abstracted to provide minimal control over their look and feel so it can change display according to device configuration. </li></ul>
  4. 4. Introduction <ul><li>>> Low Level group </li></ul><ul><li>-- These are perfect for MIDlets where precise control over the location and display of the UI elements is important and required </li></ul><ul><li>-- more Controls comes less portability </li></ul><ul><li>-- Application not deployable on certain device because they require precise control over the way they look and feel </li></ul><ul><li>-- There are only two class in this group </li></ul>
  5. 5. Introduction <ul><li>>> what ,why is Displayable and Display ? </li></ul><ul><li>-- A Displayable class is a UI element that can be shown on the device's screen. </li></ul><ul><li>-- A Display class abstracts the display functions of an actual device's screen and makes them available to you. </li></ul><ul><li>--Display provides methods to gain information about the screen and to show or change the current UI element that you want displayed </li></ul><ul><li>-- MIDlet shows a Displayable UI element on a Display using the setCurrent(Displayable element) method of the Display class. </li></ul><ul><li>-- The Display can have only one Displayable element at one time. </li></ul><ul><li>-- The current element that is being displayed can be accessed using the method getCurrent(), which returns an instance of a Displayable element. </li></ul>
  6. 6. Class Hierarchy
  7. 7. Screen <ul><li>>> Screen Class </li></ul><ul><li>-- Screen is a parent class for components that have an actual look and feel on the display. </li></ul><ul><li>Screen API: Screen Class: javax.microedition.lcdui.Screen </li></ul>
  8. 8. Form <ul><li>>> Limitation of the display on mobile Device </li></ul><ul><li>-- Overlapping windows, toolbars and cascading menus are nowhere to be found </li></ul><ul><li>-- A Form gives you the option to show multiple components on the display. </li></ul><ul><li>-- Form as a container that can hold any number of components </li></ul><ul><li>-- Components are sub class of Item. </li></ul><ul><li>-- A Form has methods to append, insert, replace and delete components. </li></ul><ul><li>-- when append a component with form ,append method will return a index value(index value is start from 0).This value is used for identifying position of the form. </li></ul><ul><li>-- another method (size) will return the number of component in a form. </li></ul>
  9. 9. Form API
  10. 10. Item <ul><li>>> Item </li></ul><ul><li>-- An Item is a component that can be added to a Form. ChoiceGroup, DateField, Gauge,ImageItem, StringItem and TextField are all subclasses of Item. </li></ul><ul><li>-- Working along with an Item is the class ItemStateListener. </li></ul><ul><li>-- ItemStateListaner will send message when an event occur. </li></ul><ul><li>-- The recipient of this message is the method itemStateChanged() </li></ul><ul><li>--- Example </li></ul>
  11. 11. DateField <ul><li>>> Using the DateField component, you manipulate a Date object (as defined in java. util. Date) using the keys and/or soft buttons on a mobile device. </li></ul><ul><li>>> When creating a DateField object you specify whether the user can edit the date, the time, or both—see the mode constants declared </li></ul><ul><li>>> Example </li></ul>
  12. 12. DateField API
  13. 13. Gauge <ul><li>>> It’s a form of measure the progress. </li></ul><ul><li>>> A Gauge has two means of being updated. </li></ul><ul><li>>> The first is referred to as interactive mode, where the user </li></ul><ul><li>makes the changes. </li></ul><ul><li>>> The second, for lack of a better term, is a non-interactive mode. It is up to you as the developer to change the values . </li></ul><ul><li>>> Example:, Non-interactive </li></ul>
  14. 14. Gauge API
  15. 15. S tringItem <ul><li>>> A StringItem displays a static label and text message </li></ul><ul><li>>> user cannot edit either the label or the text </li></ul><ul><li>>> StringItem does not recognize events </li></ul><ul><li>>> once you create a StringItem, you can get/set the text message with methods inside the StringItem class </li></ul><ul><li>>> get/set the label, you can do so using methods inherited </li></ul><ul><li>from the Item class. </li></ul><ul><li>Sample:, </li></ul>
  16. 16. StringItem
  17. 17. TextField <ul><li>>> create a TextField you can specify an input constraint. </li></ul><ul><li>>> A constraint provides restrictions on the data that a user may enter </li></ul><ul><li>>> There are four constraints to support the following specific types of input </li></ul><ul><li>--email addresses, </li></ul><ul><li>-- URLs </li></ul><ul><li>-- numeric values and </li></ul><ul><li>-- phone numbers </li></ul><ul><li>>> In addition to constraints, when you create a TextField you specify how many characters you anticipate you will need. </li></ul>
  18. 18. TextField
  19. 19. TextField API