Hi I have been trying to learn how to add some accessibility tools but it doesn’t seem to work neither on the samsung galaxy s2 nor on the emulator. I have created a simple activity and here is a layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:contentDescription="Title"
android:focusable="true"/>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:contentDescription="Button to click"
android:focusable="true"/>
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher"
android:contentDescription="Small image"
android:focusable="true"/>
</LinearLayout>
My app is set minimum level 1.6 and target 4.0 I have added the android suppport library.
Unfortunately when I try to “touch” or select these items I don’t hear the description. Of course I have activated the acessibility and the TalkBack app but the only thing I here is “screen off, volume x percent” …. Is there something else I have to do? thanks
Accessibility in Honeycomb and below requires use of a trackball or directional pad, or the Eyes-Free Keyboard which provides a virtual D-Pad and is available on the Play Store. Spoken feedback also requires a working Text-to-speech engine, so make sure your device has voice data installed.
You can find the Eyes-Free Keyboard here:
https://play.google.com/store/apps/details?id=com.googlecode.eyesfree.inputmethod.latin
When TalkBack is turned on and TTS is working properly, pressing D-Pad arrows will move focus between items, which will in turn read them (or any content description) aloud.
Ice Cream Sandwich and above have an “Explore by touch” feature that allows users to simply touch the screen to hear feedback and does not require a directional controller.
As a side note: views that already have text, like TextViews and Buttons, usually do not need content descriptions. Images that are purely decorative should have empty content descriptions, which can be set with android:contentDescription=”@null”.