Embedding web content into your app as primary or supporting content
Stay organized with collections
Save and categorize content based on your preferences.
Android lets you build on the power of the web within your app. So, you can
benefit from the flexibility and efficiency of displaying certain types of
content.
Embedding content using WebView
The WebView API gives you access to the capabilities of a mini-browser
for displaying web content within your app. This lets you provide web-powered
experiences as a core or supporting part within your app, as seen in Figure
1.
Figure 1. Web content embedded within the app with
`WebView` objects as primary (left) and supporting content (right).
What WebView can do
You can do the following with WebView in your app:
Embed web: A WebView is integrated into an app's user interface as a
component, much like a button or text field.
Load content: WebView can load web content from various sources:
Remote URLs: It can fetch and display web pages from the internet, just like
a regular browser.
Local files: It can load HTML, CSS, and JavaScript files stored within the
app's resources.
Dynamically generated content: The app can generate HTML content dynamically
and provide it to the WebView.
Render: WebView uses its browser engine to parse and render the HTML,
CSS, and JavaScript, displaying the resulting web page within its designated
area in the app's UI.
Execute JavaScript: WebView can execute JavaScript code within the
context of the loaded web page. This allows for dynamic interactions and
updates within the WebView.
Interact with your app: This is where WebView gets more powerful. It
enables bidirectional communication between the web page and the app.
JavaScript to app code: JavaScript code running in a WebView can call
host APIs of the app, enabling access to device features like camera, GPS,
or sensors.
App code to JavaScript: The app can also inject JavaScript code into a
WebView, manipulate the web page's content, or respond to events triggered
by the web page.
How WebView differs from a browser
A WebView is a highly custom component that provides the core functionality of
a window into the web. Unlike a browser, which provides a navigation bar and
other user interface elements to navigate the web more broadly, the overall
experience of a WebView is shaped by your app's design and purpose.
To better understand how WebView differs from standard browsers, see the
following explanations:
UI: A WebView is used for displaying web content and doesn't have its own
header or UI like most other common browsers, for example, a home button,
address bar, or settings menu.
Features: Many browsers have built-in features to augment the
browsing experience, such as bookmarks, permissions, or history.
Updates: Because Android WebView is a system service on Android, updates
are pushed and integrated into the apps automatically on a monthly basis.
Browsers rely on their corresponding app updates and then for end users to apply
the update on their devices.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-09-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[],[],null,["Android lets you build on the power of the web within your app. So, you can\nbenefit from the flexibility and efficiency of displaying certain types of\ncontent.\n\nEmbedding content using `WebView`\n\nThe [`WebView`](/reference/android/webkit/WebView) API gives you access to the capabilities of a mini-browser\nfor displaying web content within your app. This lets you provide web-powered\nexperiences as a core or supporting part within your app, as seen in **Figure\n1**.\n**Figure 1.** Web content embedded within the app with \\`WebView\\` objects as primary (left) and supporting content (right).\n\nWhat `WebView` can do\n\nYou can do the following with `WebView` in your app:\n\n- **Embed web** : A `WebView` is integrated into an app's user interface as a\n component, much like a button or text field.\n\n- **Load content** : `WebView` can load web content from various sources:\n\n - Remote URLs: It can fetch and display web pages from the internet, just like a regular browser.\n - Local files: It can load HTML, CSS, and JavaScript files stored within the app's resources.\n - Dynamically generated content: The app can generate HTML content dynamically and provide it to the `WebView`.\n- **Render** : `WebView` uses its browser engine to parse and render the HTML,\n CSS, and JavaScript, displaying the resulting web page within its designated\n area in the app's UI.\n\n- **Execute JavaScript** : `WebView` can execute JavaScript code within the\n context of the loaded web page. This allows for dynamic interactions and\n updates within the `WebView`.\n\n- **Interact with your app** : This is where `WebView` gets more powerful. It\n enables bidirectional communication between the web page and the app.\n\n - **JavaScript to app code** : JavaScript code running in a `WebView` can call\n host APIs of the app, enabling access to device features like camera, GPS,\n or sensors.\n\n - **App code to JavaScript** : The app can also inject JavaScript code into a\n `WebView`, manipulate the web page's content, or respond to events triggered\n by the web page.\n\nHow `WebView` differs from a browser\n\nA `WebView` is a highly custom component that provides the core functionality of\na window into the web. Unlike a browser, which provides a navigation bar and\nother user interface elements to navigate the web more broadly, the overall\nexperience of a `WebView` is shaped by your app's design and purpose.\n\nTo better understand how `WebView` differs from standard browsers, see the\nfollowing explanations:\n\n**UI** : A `WebView` is used for displaying web content and doesn't have its own\nheader or UI like most other common browsers, for example, a home button,\naddress bar, or settings menu.\n\n**Features**: Many browsers have built-in features to augment the\nbrowsing experience, such as bookmarks, permissions, or history.\n\n**Updates** : Because Android `WebView` is a system service on Android, updates\nare pushed and integrated into the apps automatically on a monthly basis.\nBrowsers rely on their corresponding app updates and then for end users to apply\nthe update on their devices.\n\nGet started\n\nFor information on how to use `WebView` in your app, see the document\n[Build web apps in `WebView`](/guide/webapps/webview).\n\nAdditional resources\n\nTo develop web pages for Android-powered devices using `WebView` objects or\nCustom Tabs, see the following documents:\n\n- [Build web apps in `WebView`](/guide/webapps/webview)\n- [Manage `WebView` objects](/guide/webapps/managing-webview)\n- [Support different screens in web apps](/guide/webapps/targeting)\n- [Debug web apps](/guide/webapps/debugging)\n- [Best practices for web apps](/guide/webapps/best-practices)\n- [Opt-in to `WebView` Beta](https://play.google.com/apps/testing/com.google.android.webview)\n- [In-app browsing using embedded web](/develop/ui/views/layout/webapps/in-app-browsing-embedded-web)\n- [Overview of Android Custom Tabs](/develop/ui/views/layout/webapps/overview-of-android-custom-tabs)"]]