Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Android accessibility 9th_april_droidcon

619 views

Published on

  • Be the first to comment

Android accessibility 9th_april_droidcon

  1. 1. Google Confidential and ProprietaryDesigning AccessibleAndroid ApplicationsApril 9, 2013
  2. 2. Google Confidential and ProprietaryAgenda● What is accessibility?● What features are available?● How do you make your app accessible?● Testing and Debugging
  3. 3. Google Confidential and Proprietary
  4. 4. Google Confidential and ProprietaryWhat framework provides● User interactions and system events generateAccessibilityEvents and send them to services● AccessibilityServices like TalkBack respond tothese events and provide feedback to the user
  5. 5. Google Confidential and ProprietaryWhat framework providesDonut (1.6) through Honeycomb (3.x)● Spoken feedback through TextToSpeech APIs● Modify your devices display and sound options○ Large text○ Change speed at which text is spoken○ Disable screen rotationIce Cream Sandwich (4.0)● Touch exploration for devices without D-Pad● Services can inspect view hierarchy
  6. 6. Google Confidential and ProprietaryWhat framework providesJellyBean (4.1)● Supports Accessibility focus○ Services can place this focuson any view○ Indicated on-screen viayellow rectangle● Supports Braille I/O devicesvia BrailleBack service
  7. 7. Google Confidential and ProprietaryWhat framework providesJellyBean (4.1)● Many actions available○ Move input focus○ Click on views○ Scroll within views○ Navigate text by words, etc.○ Perform global actions
  8. 8. Google Confidential and ProprietaryFeatures in Jelly BeanGestures● Services can respond to user-drawn gestures○ Perform accessibility actions○ Invoke global actions (Home,Back, etc.)● Deterministic access toscreen content
  9. 9. Google Confidential and ProprietaryFeatures in Jelly BeanMagnification● Available in Android 4.2● Multiple zoom modes○ Triple-tap to toggle○ Triple-tap and hold formomentary zoom
  10. 10. Google Confidential and ProprietaryFeatures in Jelly BeanGestures● Quick shortcuts available inGlobal Context Menu○ Pause feedback○ Repeat/spell last utterance○ TalkBack Settings
  11. 11. Google Confidential and Proprietary(demo)
  12. 12. Google Confidential and ProprietaryWhat framework providesAndroid sensors● SMS, Video chats, Videos with Captions● Location aware, GPS, maps, places● proximity● eyes free - motion / accelerometer / velocity tracker / light sensor● motion, environmental and position sensorsRead the Android Developer Guide for Sensors
  13. 13. Google Confidential and ProprietaryWhat framework providesGoogle Play● Paid apps in many Countries● DCBDeveloper Console● Countries and currencies● Auto Translate feature● StatisticsGlobal accessibility● i18n and l10nRead the Android Developer Guide for Localization
  14. 14. Google Confidential and ProprietaryWhat framework providesDesign recommendations● Navigation should be easy● Use recommended touch target sizes● Alternatives to time-out controls● Label UI elements meaningfully○ Minimize Chatter○ Provide feedbackRead the Android Design Guide for Accessibility
  15. 15. Google Confidential and Proprietary(demo)
  16. 16. Google Confidential and ProprietaryCode changes for AccessibilityLabeling content● Controls without text need android:contentDescription● Android Lint tool warns when images are missing descriptions● Purely decorative Views should set android:contentDescription="@null"● Use setContentDescription() to update a Views description○ Dont override getContentDescription()● EditTexts should use android:hint
  17. 17. Google Confidential and Proprietary<ImageView android:id="@+id/rounded_corner"android:contentDescription="@null"... /><ImageView android:id="@+id/search_button"android:focusable=”true”android:contentDescription="@string/search"... /><EditText android:id="@+id/search_field"android:hint="@string/search_hint"... />
  18. 18. Google Confidential and ProprietaryCode changes for AccessibilitySupporting D-Pad navigation● Prior to Android 4.0, app needs to be accessible via D-Pad○ Includes arrow keys on USB and Bluetooth keyboards○ This is easy to test in the emulator!● May need to manually specify that clickable items (e.g.ImageViews) are focusable using android:focusable="true"● Make important text focusable● Control order using android:nextFocusDown
  19. 19. Google Confidential and Proprietary<LinearLayout android:orientation="horizontal"... ><EditText android:id="@+id/edit"android:focusable=”true”android:nextFocusDown=”@+id/text”... /><TextView android:id="@+id/text"android:focusable=”true”android:text="@string/terms_of_service"android:nextFocusUp=”@id/edit”... /></LinearLayout>
  20. 20. Google Confidential and ProprietaryCode changes for AccessibilitySupporting scaled text● Android supports large fonts for low-vision use● Text sizes should be in sp "scaled pixels" instead of dips● Always test your app for text cropping, wrapping, etc.○ You should be doing this for i18n anyway!<TextView android:id="@+id/intro_text"android:textSize="14sp".... />
  21. 21. Google Confidential and Proprietary(demo)
  22. 22. Google Confidential and ProprietaryLogical grouping and ordering● View hierarchy order and on-screen positioning determine groupingfor accessibility focus and ordering of spoken feedback● Group non-focusable items (e.g. TextViews) in a focusablecontainer to have them read as a single item● Set content description on a container to override automaticgrouping and ordering of contained items
  23. 23. Google Confidential and ProprietaryLogical grouping and ordering
  24. 24. Google Confidential and ProprietaryFolderIcon android:id="@+id/folder"android:focusable="true"android:contentDescription="@string/folder_google"...><ImageView android:id="@+id/preview_background"android:contentDescription="@null"... /><BubbleTextView android:id="@+id/folder_icon_name"android:text="@string/google"... /></LinearLayout>
  25. 25. Google Confidential and ProprietaryTesting and Debugging for AccessibilityFor all Android apps○ Create checklist○ Check with real simulation○ Test on all supported Platforms○ Test on screens and densitiesScreens: small, normal, large, xlargeDensities: (low (ldpi), medium (mdpi), high (hdpi),extra high (xhdpi))
  26. 26. Google Confidential and ProprietaryTesting and Debugging forAccessibilityFor all Android apps● Enable Accessibility features○ Turn on TalkBack logging inAccessibility > TalkBack >Settings > Developersettings● Android Lint tool
  27. 27. Google Confidential and ProprietarySummaryMust do:● Use built-in Android components○ Label controls○ Make controls focusable○ Ensure traversal order is correct○ Specify text in sp○ Logically group UI elements● Fix custom components○ Implement accessibility interfaces○ Use Support library○ TouchExplorationHelper is available on Google Code● Test and Fix
  28. 28. Google Confidential and ProprietarySummaryGood to have:● Augment audio-only prompts○ Visual cues○ Haptic feedback● Evaluate sensors● Add captions to videos● Follow UI guidelines● Reach globallyRead the Android Developer Guide for Accessibility
  29. 29. Google Confidential and ProprietaryThanks and Questions?Send feedback to:soniash@google.com

×