Android Tutorial

(avery) #1

By : Ketan Bhimani


384 

WebChromeClient webChrome = new WebChromeClient() {
@Override
public void onReceivedTitle(WebView view, String title) {
Log.v(DEBUG_TAG, “Got new title”);
super.onReceivedTitle(view, title);
pageTitle.setText(title);
}
};
wv.setWebChromeClient(webChrome);


Here the default WebChromeClient is overridden to receive changes
to the title of the page. This title of the web page is then set to a
TextView visible on the screen.

Whether you use WebView to display the main user interface of
your application or use it sparingly to draw such things as help
pages, there are circumstances where it might be the ideal control
for the job to save coding time, especially when compared to a
custom screen design. Leveraging the power of the open source
engine, WebKit, WebView can provide a powerful, standards-based
HTML viewer for applications. Support for WebKit is widespread
because it is used in various desktop browsers, including Apple
Safari and Google Chrome, a variety of mobile browsers, including
those on the Apple iOS, Nokia, Palm WebOS, and BlackBerry
handsets, and various other platforms, such as Adobe AIR.

Building Web Extensions Using WebKit

All HTML rendering on the Android platform is done using the
WebKit rendering engine. The android.webkit package provides a
number of APIs for browsing the Internet using the powerful
WebView control. You should be aware of the WebKit interfaces and
Free download pdf