Getting Started in Android Development
Part 21 -
As the name implies, the WebView is an Android view that allows webpages or HTML files to be displayed within the layout. The basic code to add a WebView to an XML layout is shown below:
In the video associated with this tutorial we simply construct a layout to build a very basic browser. It comprises an EditText field, a “go” button and the WebView itself. A screenshot of the resultant layout is shown below:
Before the WebView will function you have to give the app permission to use the device's Internet service. This is done by modifying the Android Manifest file as shown below:
The next tutorial focuses on adding the Java code to complete the WebView functionality.
Permissions are used by the market place to inform the user what services the app will use.
After this tutorial your WebViewActivity.java file will look similar to the one below:
After this tutorial your activity_webview.xml layout file will look similar to the one below:
After this tutorial your ListviewActivity.java file will look similar to the one below:
After this tutorial your Android Manifest file will look similar to the one below:
Download Download tutorial set 1