Using WebView
Your manifest must include the INTERNET
permission. This is how we add it.
Open the AndroidManifest.xml
file, and add the following line of highlighted code, which is shown with a bit of context:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.gamecodeschool.widgetexploration"> <uses-permission android:name="android .permission.INTERNET" /> <application … …
Finally, we will add two more lines of code in order to grab a reference to the WebView
widget and load up a website. It should be a relatively straightforward process to modify the code in order to load any website that you like. Add the following lines of code to the end of the onCreate...