Image source: Google I/O

Android apps for everyone: How to audit your app with the Accessibility Scanner

Bigyan Thapa
Propeller Health Tech Blog
5 min readSep 28, 2020

--

At Propeller Health, we work hard to provide services to our users in every stage of life. This includes making our products and services accessible. Recently we have been focusing on figuring out the areas we need to improve in terms of accessibility. So, we took the approach of assessing our app for accessibility. Here, I am describing the approach we took, so that the readers can access their apps and make their products and services accessible to a larger user group.

Even in the peak of the technological era, applications are still designed and developed with a one-size-fits-all approach, which simply doesn’t work when it comes to accessibility needs. This approach makes it very difficult for a significant group of users to access these products and resources.

As illustrated by the cover photo above from Google I/O and The World Bank’s statistics, 15% of the world’s population (between 110 million and 190 million people) experience some form of disability. These accessibility needs include color blindness, impaired vision, impaired hearing and impaired dexterity, as well as physical limitations that can make Android devices difficult to use for day-to-day tasks. This means if we design and develop our application with accessibility in mind, we can be confident that we are serving more of our potential users.

Section 508 of the Rehabilitation Act (29 U.S.C. § 794d) requires federal agencies to develop, procure, maintain and use information and communications technology that is accessible to people with disabilities, -regardless of whether or not they work for the federal government. This clearly suggests that accessibility is not just an aspect of designing and development applications, it is also the right of users. W3C Web Accessibility Initiative (WAI) has defined the standards and guidelines of developing accessible software products. In this article, we will learn some accessibility best practices and how to test an Android app for accessibility.

Android Accessibility Best Practices

As we start assessing our app, we will not have to ignore the lint warning for ContentDescription, tools:ignore="ContentDescription" ❌. We will understand when to provide content description and when to exclude view components from accessibility service.Android developer guidelines list following as UI accessibility best practices:

  • Label elements
  • Use or extend system widgets
  • Use cues other than color
  • Make media content accessible

Making apps more accessible is an incremental task unless the app is brand new and accessibility was addressed from the very beginning. We can start the journey of making our app more accessible by providing content descriptions, proper color contrast and correct dimensions for clickable/tappable UI components. Content description can usually be for ImageView or a group of TextViews. But to start this improvement work, first we need to know what is broken. For this we can use Google’s Accessibility Scanner tool, available on Android 6 and above.

How to enable and use Accessibility Scanner

To use the Accessibility Scanner, first we need to install the Accessibility Scanner app from the Google play store. On install, we will be promoted to navigate to our phone’s Accessibility settings. Now we tap Accessibility Scanner and then tap Use Service switch to enable accessibility settings. Tap Allow and then tap Begin authorization on the final prompt. The Accessibility scanner needs to run over other apps, so we need to provide this permission as well.

We need to be mindful while using the Accessibility Scanner, as it can capture any sensitive information that is displayed on our screen or played from our device, including audio, passwords, payment info, photos and messages.

After this setup is done, we can run the app we want to test. Then we can tap on the accessibility scanner icon to begin the testing. Below are the screenshots of the flow for reference:

Enable Accessibility Scanner steps

To turn off the Accessibility Scanner, navigate to:
Settings -> Accessibility -> Accessibility Scanner -> Tap Use Service -> Tap Stop

Two approaches of testing

We can perform the accessibility test in following two approaches:

Snapshot

With the snapshot approach, we test the app on a screen by screen basis. The Accessibility scanner will take a screenshot of the screen-under-test and provide the results on screen by adding red borders around the UI components.

For example, when you click on the Uninstall button in the above screenshot, a bottom-sheet is displayed with two accessibility issues: Text contrast and Touch target. These fields can be expanded to get further details and recommendations for resolution. Below images illustrate this further:

Sample snapshot test with Accessibility Scanner

Record

With this approach, we test any flow in the app rather than on a screen by screen basis. The Accessibility scanner will record the video of the flow-under-test. Once we stop recording, the Accessibility scanner will provide the results for the tested flow adding red borders around the UI components similar to the snapshots. Then we can follow the steps mentioned above to get more details.

Sample Flow-Test with Accessibility Scanner

Accessibility Scanner helps us find three major accessibility issues in our app: missing content description, improper color-contrast and incorrect touch-target for UI components. We can share our test results with the designers or product team and work towards prioritizing the resolution strategy and building accessible apps moving forward.

References:
https://support.google.com/accessibility/android/answer/6006564?hl=en
https://developer.android.com/reference/android/accessibilityservice/AccessibilityService

--

--

Bigyan Thapa
Propeller Health Tech Blog

Senior Mobile Engineer @ Sprout Social, Android Dev, Chicago, USA