21761 leitner-pk edits and alt text 6oct11

Upload: james-mwai

Post on 06-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    1/37

    1 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    2/37

    2 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Mobile Accessibility with LWUIT

    Peter Korn, Accessibility Principal, Oracle

    Ofir Leitner, Software Developer, Oracle

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    3/37

    3 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    3 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    The following is intended to outline our general product direction.It is intended for information purposes only, and may not beincorporated into any contract. It is not a commitment to deliverany material, code, or functionality, and should not be relied uponin making purchasing decisions. The development, release, andtiming of any features or functionality described for Oraclesproducts remains at the sole discretion of Oracle.

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    4/37

    4 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Program Agenda

    Background on accessibility: laws & regulation

    Accessible mobile devices in the market

    Background on LWUIT

    Architecture & code examples

    Demos Thanks and Q&A

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    5/37

    5 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Accessibility Basics

    Accessibility is about making user interfacesperceivable, operable, and understandable bpeople with a wide range of abilities.

    Definition

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    6/37

    6 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Accessibility Basics

    Making products work for Users with visual impairments

    Users with hearing impairments

    Users with motor impairments

    Users with cognitive impairments

    People with temporary disabilities Situational limitations

    The aging population

    What it means

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    7/37

    7 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Accessibility Basics - AT

    Assistive, Access or Adaptive Technology: devices for people with disenable people to perform tasks that they were formerly unable to acco

    great difficulty accomplishing, by providing enhancements to or changeinteracting with the technology needed to accomplish such tasks.

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    8/37

    8 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Mobile Accessibility Laws and Regulat

    Section 508 of the Federal Rehabilitation Act

    U.S. govt procurement of Electronic and Information Techn

    EU Mandate 376 Section 508 for all of Europe

    Applies to EU Information and Communication Technology

    Department of Justice & Americans with Disabilities A

    Applying ADA to situations like eBook readers used in scho

    21st Century Communications & Video Accessibility

    Advanced Communications & web browsing mobile phone

    UNConvention on the Rights of Persons with Disab

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    9/37

    9 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Accessible Mobile Phones

    First accessible phones: brittle reverse-enginee Symbian, Windows Mobile with expensive 3rd party AT

    Newer phones: accessibility APIs; some with bu BlackBerry with 3 rd party AT

    Android & iPhone with included screen readers, iPhon

    Growing 3 rd party AT offerings for Android & iPhone

    BUT... Few options for accessible Java apps

    Accessible phones are the most expensive Smart Pho

    Java ME in a marketplace of accessible phones

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    10/37

    10 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    LWUIT INTRO

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    11/37

    11 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    What is LWUIT?

    Advanced, lightweight UI library

    Compelling UI Consistent across different devices

    For today's handsets (and more ...)

    Portable MIDP, Blackberry, Android, CDC, SE, TV, ...

    Inspired by Swing

    Tools support Open Source!

    GPLv2 + Classpath Exception, free for commercial use Active community

    Lightweight User Interface Toolkit

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    12/37

    12 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    LWUIT: Key Benefits

    Rapid development

    Familiar API Clean & simple

    Easy deployment One jar, many devices

    Consistent & flexible Customizable, extensible

    Filthy Rich UI Brand-able

    Designed for mass market devices Tested on broad range of hardware

    Easy Development and Deployment

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    13/37

    13 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    LWUIT: Key Features

    Swing-like MVC

    Layouts Fonts

    Rich widgets

    HTML widget

    3D & SVG integration

    Touch screen support Animations & transitions

    Pluggable Look & Feel, theming

    I18N/L10N support

    Rich Functionality

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    14/37

    14 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    ACCESSIBILITY: THE BASICS

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    15/37

    15 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Accessibility Requirements for LWUIT

    Needs to be operable from the keyboard (by so

    who cant use a touchscreen) LWUIT already has full phone keyboard operability

    Needs to support a variety of themes for folks wvision e.g. high contrast, large print

    LWUIT already themeable

    Needs to support an accessibility API for interowith assistive technologies The subject of the remainder of this presentation

    What needs to be there to support users with dis

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    16/37

    16 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Accessibility API requirements

    Expose detailed information about UI compone

    Role, state(s), boundary, name & desc.

    Min/max/current value of anything that takes a value (

    Text contents, attributes, boundary of all text on the di

    Relationships of UI components with each other; inclu

    Fire events when things happen to UI compone Focus, text caret, selection, other UI component chan

    Allow programmatic modification of UI compon Text insertion, selecting items in list, checking buttons

    Industry consensus on a sufficient accessibility

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    17/37

    17 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Goals and Constraints

    Minimal impact on phones that aren't running A

    Minimal impact on LWUIT API (only add sometreally need to)

    Run with existing LWUIT apps

    Minimal runtime impact for accessibility metadaname of icons, associating labels with text field

    Support native AT, support Java AT

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    18/37

    18 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Roles

    LWUIT base components mapped to ARIA role

    Roles are determined by: If a role client property is assigned, then it overrides everyth

    instanceof checks: e.g. if component is TextArea: its role is T

    UIID checks: e.g. if the component is a Dialog, then if its UIIDrole is MENU (otherwise its role is DIALOG)

    Hierarchy checks: e.g. if grandparent of a component is a Tait is either a TAB or a TABPANEL (according to class and UI

    Added roles:

    LWUITCOMPONENT (Generic custom component)

    CONTAINER, LABEL

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    19/37

    19 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Attributes or States

    LWUIT base components get some attributes i

    The user can specify attributes in the component's clieproperties. These will override everything.

    Attributes are determined by base component states. example:

    aria-disabled by isEnabled()

    aria-visible by isVisible()

    aria-checked by isSelected()

    aria-expanded, aria-setsize, aria-posinset, aria-level fo

    Some attributes will be empty by default, since no bascomponent supports them (aria-owns)

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    20/37

    20 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    ARCHITECTURE

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    21/37

    21 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Architecture

    The Event Bus listens on 2 TCP/IP ports, one for ATs and one for The Bus opens an AppHandler/ATHandler instance for each app/AT

    ATHandler listens to AT queries, and forward relevant App events to the AT

    AppHandler listens to App events, and forwards relevant AT queries to the Ap

    All 3 runtimes share a common package that is used to serialize event onetwork (And also includes some constants such as roles and attribute

    While current implementation is done with TCP/IP, we plan to use also Oprotocol.

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    22/37

    22 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Architecture

    ATBroker provides for AT developers event listeners and query methe other hand communicates with the Bus via TCP/IP (Or IMC in

    The AT can signal (via the ATBroker) to which events it would like

    The ATBroker receives App events, and notifies all listeners for tha

    The AT can query components states, children, bounds etc, all viamethods which are translated to objects that are serialized and se

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    23/37

    23 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Architecture

    The broker once started with Broker.init(), starts polling the application UI.

    Once a new Form comes up, it adds itself (and helper objects) as listeners to all comp

    In addition it polls other changes to the UI for which we do not have events (Such as hcaret events etc.) and sends them as events to the Bus

    Events are then sent to the Bus as serialized AEvent objects (The Bus then decides to be forwarded, according to what the ATs specified)

    The broker also does the job of assigning LWUIT base components with roles an

    The Broker works in a transparent way to the LWUIT App developer, and aside frthe developer doesn't use it (Perhaps aside of constants)

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    24/37

    24 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Packages

    accessibility.common a common package used by all 3 run

    (AT/App/Bus) for a unified way of serializing event objects. Inc AEvent the base event class. Basically serializes the event type and a que

    also be a query or response (Considering elaborating the class structure)

    Other events: RegisterEvent (App/AT identification), FocusEvent, Compone(queries component states/children etc.), StatesResponses (Returns compo

    Role constants representing the ARIA roles and their names

    Attribute constants representing the ARIA att. and their names

    accessibility.bus contains the bus classes (Bus, ATHandler

    accessibility.at Used by AT developers (Contains ATBroker,

    accessibility.app Used by the LWUIT App, contains mainly t

    C d S l E bli A ibili

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    25/37

    25 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Code Samples: Enabling Accessibility

    Making a LWUIT app accessible is very easy, s

    to your midlet:

    Broker.init(App Name);

    Notes:

    This should be added after the Display.init(midlet) ca Your app should use the ATBroker project

    This applies to the prototype only, when the accessibitechnology will be integrated into OJWC, There wouldto explicitly initialize the broker, it would be done by LW

    C d S l C t P ti

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    26/37

    26 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Code Samples: Custom Properties

    Most ARIA properties are determined automatically

    Broker. However, some custom components may require s

    various properties

    Example: Let's say that we have a custom componneeds to relay the information that it has 6 items:

    putClientProperty(Attribute.getAttName(Attribute.ARIA_SE

    Notes: Only properties listed in the Attribute class are relevant

    Property changes are scanned by the Broker via polling

    C d S l S tti t

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    27/37

    27 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Code Samples: Setting components na

    Another way of adding accessibility info is by u

    component.setLabelForComponent(Label compone This was created in LWUIT for other uses.

    It is especially useful for components that dont have aname (For example TextArea/Field vs. Label/Button)

    Example:

    Label nameLabel = new Label(Name:);TextField nameField = new TextField();

    container.addComponent(nameLabel);

    container.addComponent(nameField);

    nameField.setLabelForComponent(nameLabel);

    C d S l Li tC llR d

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    28/37

    28 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Code Samples: ListCellRenderers

    Work is needed for custom list cells

    Set the appropriate Role for the cell Set the appropriate Name, Description

    Ensure correct Selection, item count

    Example from ScrollDemo.java:

    public Component getListCellRendererComponent(List list, Object value, int index, boolean isS

    Contact person = (Contact) value;

    name.setText(person.getName());

    email.setText(person.getEmail());

    pic.setIcon(person.getPic());

    return this;

    }

    Code Samples ListCellRenderers cont

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    29/37

    29 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Code Samples: ListCellRenderers cont

    public Component getListCellRendererComponent(List list, Object value, int index, boolea

    Contact person = (Contact) value;

    name.setText(person.getName());email.setText(person.getEmail());

    pic.setIcon(person.getPic());

    putClientProperty(Attribute.ATT_NAMES[Attribute.ROLE], new Integer(Role.LIST

    putClientProperty(Attribute.ATT_NAMES[Attribute.ALT], person.getName() + " "

    if (isSelected) {

    putClientProperty(Attribute.ATT_NAMES[Attribute.ARIA_SELECTED], Boolean

    }

    putClientProperty(Attribute.ATT_NAMES[Attribute.ARIA_POSINSET],

    Integer.toString(index));

    putClientProperty(Attribute.ATT_NAMES[Attribute.ARIA_SETSIZE],

    Integer.toString(5*CONTACTS_INFO.length));

    return this;

    }

    Code Samples: Assistive Technology

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    30/37

    30 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Code Samples: Assistive Technology

    Writing an assistive technology is also quite easy.

    First, initialize the ATBroker: ATBroker.getInstance().init(midlet,"AT Name");

    Implement the relevant Listener

    For focus for example, implement AFocusListener that gets called on its focmethod.

    Other listeners:

    AHierarchyListener, ADataChangeListener, ACaretListener, APropertyChangeLi

    Then, register on events:

    ATBroker.getInstance().addFocusListener(this);

    Notes:

    This should be added after the Display.init(midlet) call.

    Your app should use the ATBroker project

    Code Samples: Assistive Technology

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    31/37

    31 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Code Samples: Assistive Technology

    import accessibility.at.AFocusListener;

    import accessibility.at.ATBroker;

    import accessibility.common.FocusEvent;

    import javax.microedition.midlet.MIDlet;

    import javax.microedition.midlet.MIDletStateChangeException;

    public class SimpleATMIDlet extends MIDlet implements AFocusListener {

    protected void startApp() throws MIDletStateChangeException {

    ATBroker.getInstance().init(this, "Simple AT");

    ATBroker.getInstance().addFocusListener(this);

    }public void focusGained(FocusEvent event) {

    System.out.println("Gained focus on " + event.getName() + " (Role: " + event.g

    }

    protected void pauseApp() { }

    protected void destroyApp(boolean unconditional) throws MIDletStateChangeExceptio

    }

    Monkey Application

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    32/37

    32 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Monkey ApplicationScans all UI components and provides details ab

    Demonstrates the ability

    for AT to query entire UIhierarchy

    Also a great accessibilitydebugging tool

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    33/37

    33 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Demos

    Thanks to our Partners

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    34/37

    34 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

    Thanks to our Partners

    LWUIT accessibility work is supported by the Europ

    Commission as part of the GIS project EC Grant: FP7 ICT-224348

    Project website: http://www.aegis-project.eu

    Public presentations: http://www.slideshare.net/aegisprojec

    Thanks to GIS partners who contributed to this w

    Research In Motion Center for Research & Technology, Hellas

    Foundation Vodafone Spain

    University Polytechnic Madrid

    Czech Technical University

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    35/37

    35 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. | Insert Information Protection Policy Classification from Slide 8

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    36/37

    36 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. |Insert Information Protection Policy Classification from Slide 8

    Q&A

  • 8/3/2019 21761 Leitner-PK Edits and ALT Text 6Oct11

    37/37

    37 | Copyright 2011, Oracle and/or its affiliat es. All rights reserved. |Insert Information Protection Policy Classification from Slide 8