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

There are currently no vacancies.

OUR VIDEO RECOMMENDATION

, ,

Migrating to Jetpack Compose – an interop love story

Most of you are familiar with Jetpack Compose and its benefits. If you’re able to start anew and create a Compose-only app, you’re on the right track. But this talk might not be for you…
Watch Video

Migrating to Jetpack Compose - an interop love story

Simona Milanovic
Android DevRel Engineer for Jetpack Compose
Google

Migrating to Jetpack Compose - an interop love story

Simona Milanovic
Android DevRel Engin ...
Google

Migrating to Jetpack Compose - an interop love story

Simona Milanovic
Android DevRel Engineer f ...
Google

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
In this part of our series on introducing Jetpack Compose into an existing project,…
READ MORE
blog
In the world of Jetpack Compose, where designing reusable and customizable UI components is…
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

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