One of the latest updates for the Android SDK plugin in Eclipse introduced a lot of new warnings for your layouts and such. One of these is an accessibility warning that appears if you don't have the android:contentDescription
tag set. This resulted in hundreds of warnings in one of my projects, and that naturally makes it a lot harder for me to find other more important warnings.
Looking at the official documentation, it seems that this tag is pretty useless from an end-user's perspective. Here's the description of it:
Defines text that briefly describes content of the view. This property is used primarily for accessibility. Since some views do not have textual representation this attribute can be used for providing such.
So basically, my question is what's the purpose of that tag? It only seems to be taking focus away from the "real" errors / warnings, and I don't really see how it can be an accessibility warning if it doesn't affect the user.
When using an ImageView , ImageButton , CheckBox , or other View that conveys information graphically, use an android:contentDescription attribute to provide a content label for that View . A content label sometimes depends on information only available at runtime, or the meaning of a View might change over time.
Fortunately, implementing content descriptions is simple. You can do this by adding the contentDescription attribute to your XML layout. It can also be done programmatically by calling the setContentDescription method in your Java file.
Non-textual widgets like ImageViews and ImageButtons should use the contentDescription attribute to specify a textual description of the widget such that screen readers and other accessibility tools can adequately describe the user interface.
For some disabled people that tag almost similar to the "alt" tag in HTML, therefore it IS useful to the end user. Effectively it will allow a textual description to be presented to the user of what they may not be able to see clearly/interact with.
From the Android docs:
Defines text that briefly describes content of the view. This property is used primarily for accessibility. Since some views do not have textual representation this attribute can be used for providing such.
EDIT: Ice Cream Sandwich accessibility features are described in this article http://www.ubergizmo.com/2011/11/android-ice-cream-sandwich-accessibility/
There is a mention in this Google article as part of Android 4.0 highlights http://developer.android.com/sdk/android-4.0-highlights.html#UserFeatures
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With