22

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.

enter image description here

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.

1 Answer 1

21

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

6
  • 1
    When is it presented to these users? The warnings only appear on my ImageViews. Feb 11, 2012 at 17:29
  • 2
    Take a look at this ubergizmo.com/2011/11/android-ice-cream-sandwich-accessibility this explains in a bit of detail the ICS accessibility features. Why does it only appear on ImageViews? Well this is because they are images and Android doesn't have the ability (yet) to 'look' at the image and tell the user what it is of. Feb 11, 2012 at 17:33
  • Thanks, that's excellent! I knew it could do something like this, but I wasn't sure how it worked exactly. Looks like I'll have to go through several hundred ImageViews to support that kind of accessibility then. Feb 11, 2012 at 17:39
  • 2
    I have/do spend a lot of time on accessibility in general. I would be the first to say thanks for spending that time as touch devices offer a great opportunity to the visually impaired, and by you spending time on this you are only adding positive things to that experience. Feb 11, 2012 at 17:42
  • Hi, Exactly when does this gets used? I mean does this content description ever get presented to the user who is using the app. Mar 28, 2019 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.