Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessibility and Android WebView

Tags:

Is Accessibility enabled for Android WebView? Can anyone tell how to make a WebView accessible?

like image 539
Nemo Avatar asked May 17 '12 11:05

Nemo


People also ask

What is the use of WebView in android?

The WebView class is an extension of Android's View class that allows you to display web pages as a part of your activity layout. It does not include any features of a fully developed web browser, such as navigation controls or an address bar. All that WebView does, by default, is show a web page.

Is Android WebView deprecated?

This interface was deprecated in API level 12. This interface is now obsolete.

What is alternative of WebView in android?

Alternatives to WebView If you want to send users to a mobile site, build a progressive web app (PWA). If you want to display third-party web content, send an intent to installed web browsers. If you want to avoid leaving your app to open the browser, or if you want to customize the browser's UI, use Custom Tabs.

What is Android accessibility tool?

TalkBack. TalkBack is Android's built-in screen reader. When TalkBack is on, users can interact with their Android device without seeing the screen. Users with visual impairments may rely on TalkBack to use your app.


2 Answers

The Android webview accessibility is enabled via javascript injection in Honeycomb and above (as pointed out by alanv). The user must enable it by:

  • Turning on Accessibility mode, including 'Explore by Touch' in 4.0+.
  • Enabling 'Enhanced Web Accessibility', or, on older devices, 'Inject Web Scripts'.

This works by injecting javascript into each loaded pages via <script> tags. Note that you will have to be careful, as not all content will play nice with this javascript, and the injection will fail in some edge cases.

like image 164
krakatoa Avatar answered Oct 04 '22 03:10

krakatoa


You can extend the WebView class to implement Accessibility API methods.

http://developer.android.com/guide/topics/ui/accessibility/apps.html#custom-views

like image 32
keaton_fu Avatar answered Oct 04 '22 02:10

keaton_fu