[MUSIC PLAYING]
SPEAKER: When building Android apps,
it's important to integrate accessibility testing as part
of your development process.
In this video, we'll talk about what
it means to test for accessibility in your app
and summarize the different ways to approach testing.
Here are some of the things you should look for when testing
your app for accessibility.
Do all buttons and images have a meaningful label?
Do all text and images have sufficient color contrast
in both light and dark mode?
Do all interactable UI elements have an adequate touch target
size?
And can a user complete all the user flows
in the app using an accessibility service
such as TalkBack?
Let's briefly recap why it's important to test
for each of these things in your app,
starting with meaningful labels.
When an accessibility service such as TalkBack
is used to interact with your app,
each UI element is announced by the content description
provided.
If an image button doesn't include a content description,
TalkBack will announce it as an unlabeled button.
However, with a meaningful content description,
TalkBack will announce it as Add Task, button,
double tap to activate.
This gives the user much better context
about the purpose of the button.
To learn more about best practices
around labeling elements, check out the video "Labeling Images
for Accessibility."
Color contrast for text and images
is another important aspect to consider
when testing for accessibility.
When foreground and background colors of UI elements
have insufficient contrast, text can be hard to read,
and icons can be hard to see.
Proper color contrast helps users with visual impairments
more easily use your app and helps everybody in general use
your app in bright settings, such as outdoors in the sun.
To learn more, the "Color Contrast for Accessibility"
video goes in depth about best practices
for implementing and testing for sufficient color contrast.
Proper color contrast helps users
to see what's on the screen, but it's also
important to ensure that users can easily interact
with the elements on screen.
Any onscreen element that someone
can touch to perform an action on your app
should be large enough for reliable interaction.
For users with mobility impairments such as hand
tremors, small touch targets may be difficult to interact with.
Even users with perfect touch may
struggle to easily use controls if they are using one hand,
have large fingers, have low vision,
or are exposed to shaking, such as when they
are walking or riding a bus.
So it's important to provide reliable interaction
for all users by ensuring UI elements have
a sufficient touch target size.
Learn more about ensuring adequate touch targets
in the video "Touch Targets."
Lastly, it's important to remember
that not everybody interacts with their device
with gestures such as taps and swipes.
Therefore, it's important to test your app
by navigating through it with an accessibility service
such as TalkBack or Switch Access.
By interacting with your app using an accessibility service,
you can experience the app as your users would.
When exploring your app with an accessibility service,
you should pay close attention to the following.
Are you able to reach all the interactable elements
on the screen?
Are you able to complete all the user flows easily?
For example, if there is a drag and drop action,
is an alternative provided?
Learn more about the accessibility services
TalkBack and Switch Access in the two videos "TalkBack"
and "Switch Access."
Now that we've talked about some of the things
to look for when testing accessibility in an app,
let's look at some tools that are available to help you
with testing.
Android Studio contains built-in accessibility checks
to help make your layouts more accessible.
When using the layout editor, you
can click on the Issue Report button
to see accessibility-related issues, including suggestions
on how to fix them.
To learn more about the checks in Android Studio,
check out the video "What's New in Accessibility
for Developers."
The Accessibility Scanner app is another tool
that can help with your testing flow.
Using Scanner, you can take screenshots or videos
of your app and see specific suggestions
on how to improve the accessibility of your app.
If you want an in-depth walkthrough of the scanner app,
including what issues it looks for
and how to use it for testing your apps,
be sure to check out the "Accessibility Scanner" video.
Another tool that can help you identify
ways to improve the accessibility of your app
is through Google Play's pre-launch reports.
Pre-launch reports are available for all apps distributed
on Google Play.
These reports are generated after you upload an app
to the release channel using the Google Play console and contain
snapshots of your app that represent ways to improve
your app's accessibility.
For more information about pre-launch reports,
be sure to check out the documentation linked
in the video description below.
Besides these tools, you can also
incorporate automated testing as part of your development
workflow.
If you have existing Espresso tests,
you can enable and configure accessibility testing
using the AccessibilityChecks class.
With just a few lines of code, you
can enable accessibility checks on the entire view
hierarchy of the screen that's part of your existing Espresso
test.
The video "Espresso and Accessibility Test Framework"
gives an in-depth overview on how
to set up accessibility checks as part of your Espresso tests.
It's important to remember that the topics brought up
in this video are not the only issues that
can affect accessibility, and automated testing tools
can't detect all issues.
Ultimately, it's the users of your app
that can best determine whether the app meets their needs
and abilities.
Thanks for watching, and we hope this video gives a better
perspective on how to incorporate
accessibility testing into your development process.
[MUSIC PLAYING]