Android Tutorial

(avery) #1
Android Tutorial 377

Using Android Web APIs

Mobile developers often rely upon web technologies to enrich their
applications, provide fresh content, and integrate with popular web
services such as social networks. Android application can harness
the power of the Internet in a variety of ways, including adding
browser functionality to applications using the special WebView
control and extending web-based functionality using standard
WebKit libraries. Newer Android devices can also run Flash
applications. In this chapter, we discuss the web technologies
available on the Android platform.

Browsing the Web with WebView

Applications that retrieve and display content from the Web often
end up displaying that data on the screen. Instead of customizing
various screens with custom controls, Android applications can
simply use the WebView control to display web content to the
screen. You can think of the WebView control as a browser-like
view.

The WebView control uses the WebKit rendering engine to draw
HTML content on the screen. This content could be HTML pages on
the Web or it can be locally sourced. WebKit is an open source
browser engine. You can read more about it on its official website.

Using the WebView control requires the
android.permission.INTERNET permission. You can add this
permission to your application’s Android manifest file as follows:

Free download pdf