Learn how to use WebView xml file to get data from website in Android Studio version 1.5.1, complete tutorial step by step.
Create New Project with Application name: WebView; Minimum SDK: API 10 – Android 2.3 (Gingerbread).

In app->res->layout->activity_main.xml add the WebView with code:

<WebView
        android:id="@+id/webview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

Get data from website with WebView

In app->java->MainActivity complete the code (in onCreate):

        WebView webView = (WebView)
                findViewById(R.id.webview);
        webView.loadUrl("https://www.youtube.com/channel/UCtDPbPkC-4RrfKv7L8il7pA");

Get data from website with WebView

In manifest->AndroidManifest.xml add the permissions:

<uses-permission android:name="android.permission.INTERNET" />

Get data from website with WebView

Run your app in Emulator or in Mobile device and see displayed chosen website.

Download free WebView app (GetData.apk) from here and install it on your device to see how works.

Check next tutorials to learn all about Android.
For further questions leave a message.

3 Comments

You can follow any responses to this entry through the RSS 2.0 feed.

Hi,

i followed same steps but not able to scroll and the screen was freeze.

Thanks.

    Try putting your webview inside a scroll view

goood like

very nice

tanx

Leave a Reply

Your email address will not be published. Required fields are marked *

Blue Captcha Image Refresh

*