Blog Infos
Author
Published
Topics
,
Author
Published
Posted By: Nav Singh

Today we will learn accessibility in general and how to implement and test it in our applications.

It is about making sure that users who have limited vision or other physical impairments can use your application.

  1. Increase your app’s reach
    According to the World Bank, 15% of the world’s population has some type of disability. People with disabilities depend on apps and services that support access to communicate, learn, and work.
  2. Improve your app’s versatility
    Accessibility can make it easier for all users to interact with your app, not only those with disabilities.

One of the main ways that Android enables accessibility is by allowing users to hear spoken feedback that announces the content of user interface components as they interact with applications.

  1. Task flows: Design well-defined, clear task flows with minimal navigation steps.
  2. Action target size: Make sure buttons and selectable areas are of sufficient size for users to easily touch them, especially for critical actions. How big? (48dp (roughly 9mm) or larger).
  3. Label user interface: Label user interface components that do not have visible text.
  4. Enable focus-based navigation: Make sure users can navigate your screen layouts using hardware-based or software directional controls (D-pads, trackballs, and keyboards).
  • Add label to decorative views like Imageview:
android:contentDescription="Application logo"
  • If the view is there just for the decorative purpose you can skip it when users accessing your app using accessibility tools e.g. Talkback:
android:contentDescription="@null"
OR 
android:importantForAccessibility="no"
  • Setting text as the heading:
// only avaialble for API 28 or higher
android:accessibilityHeading="true"
  • Set the view to be focusable for ScreenReader:
// only avaialble for API 28 or higher
android:screenReaderFocusable="true"
  • Set the navigation between views:
↓ android:nextFocusDown="@id/textview_2"
← android:nextFocusLeft="view id"
↑ android:nextFocusUp="view id"
→ android:nextFocusRight="view id"
  • Set Textview as a label for any other field e.g. EditText:
android:labelFor="view id"
  • Set how accessibility services process the view changes:
android:accessibilityLiveRegion="none || assertive || polite"
  • Process the view as a single group:
// add the following properties to the parent tag
android:focusable="true"
OR
// only avaialble for API 28 or higher
android:screenReaderFocusable="true"

The colors of your app’s interface affect how easily users can read and understand it. So make sure that there is a sufficient color contrast that makes text and images easier to read and understand.

Implementation
  • In your app’s user interface, specify background and foreground colors with sufficient color contrast.
  • For TextView use android:textColor and android:background to define foreground and background colors with a high contrast ratio.

The W3C recommends:

  • At least 4.5:1 for small text (below 18 points regular or 14 points bold)
  • At least 3.0:1 for large text (18 points and above regular or 14 points and above bold)
  • Manual testing: Interact with your app using Android accessibility services.
  • Testing with analysis tools: Use tools to discover opportunities to improve your app’s accessibility(Talkback, Accessibility scanner)
  • Automated testing: Turn on accessibility testing in Espresso and Robolectric.
init {
AccessibilityChecks.enable().setRunChecksFromRootView(true)
}
  • User testing: Get feedback from real people who interact with your app.
  • Pre-launch report on Google Play

Job Offers

Job Offers


    API Engineer

    American Express
    London
    • Full Time
    apply now

    Android Engineer

    American Express
    Phoenix, USA
    • Full Time
    apply now

    Mobile Developer Android (m/w/d) Firebase

    REWE digital
    Köln / Cologne
    • Full Time
    apply now
Load more listings

OUR VIDEO RECOMMENDATION

Jobs

YOU MAY BE INTERESTED IN

YOU MAY BE INTERESTED IN

blog
It’s one of the common UX across apps to provide swipe to dismiss so…
READ MORE
blog

How to animate BottomSheet content using Jetpack Compose

Early this year I started a new pet project for listening to random radio…
READ MORE
blog
Yes! You heard it right. We’ll try to understand the complete OTP (one time…
READ MORE
blog
The dictionary defines the term side-effect as an undesirable effect. While this applies to…
READ MORE

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.

Menu