WebView in Android using Jetpack Compose Last Updated : 18 May, 2025 Comments Improve Suggest changes Like Article Like Report In Android, a WebView is an extension of View Class that allows us to display webpages. In simpler words, if you want to display a webpage in Activity Layout, then you can implement a WebView to display it. It is very similar to a browser but isn't one. A WebView can rather be referred to as a show or a preview of a browser as it lacks most functionality of that of a browser like a search input, new tabs, incognito, etc. In this article, we will show you how you could implement a WebView in Android using Jetpack Compose.Step by Step ImplementationStep 1: Create a New Project in Android StudioTo create a new project in the Android Studio, please refer to How to Create a new Project in Android Studio with Jetpack Compose.Step 2: Add Internet permission in the manifest fileNavigate to the app > manifests > AndroidManifest.xml file and add the following line of code under the <manifest> tag.<uses-permission android:name="android.permission.INTERNET" />Step 3: Working with the MainActivity.kt fileGo to the MainActivity.kt file and refer to the following code. Below is the code for the MainActivity.kt file. Comments are added inside the code to understand the code in more detail.MainActivity.kt: Kotlin package com.geeksforgeeks.demo import android.os.Bundle import android.view.ViewGroup import android.webkit.* import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.compose.material3.* import androidx.compose.runtime.* import androidx.compose.ui.viewinterop.AndroidView class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { MaterialTheme { // call composable WebViewExample() } } } } // composable with a AndroidView @Composable fun WebViewExample() { // Declare a string that contains a url val mUrl = "https://www.wikipedia.com" // Adding a WebView inside AndroidView with layout as full screen AndroidView(factory = { WebView(it).apply { layoutParams = ViewGroup.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ) webViewClient = WebViewClient() loadUrl(mUrl) } }, update = { it.loadUrl(mUrl) }) } Output: Comment More infoAdvertise with us Next Article WebView in Android using Jetpack Compose A aashaypawar Follow Improve Article Tags : Kotlin Android Android-Jetpack Similar Reads Popup Window in Android using Jetpack Compose Pop Up Window is seen in most of the applications to show the pop-up messages within the applications to the user. These pop-ups are used to display an offer image, alerts, and other important information within the android application. In this article, we will take a look at How to implement Pop Up 5 min read Text in Android using Jetpack Compose Jetpack Compose is a new toolkit provided by Google. This is useful for designing beautiful UI designs. Android Text is a simple view in Android which is used to display text inside our App. In this article, we will take a look at the implementation of Text in Android using Jetpack Compose. Importan 5 min read Button in Android using Jetpack Compose Jetpack Compose is a new toolkit provided by Google. This is useful for designing beautiful UI designs. A Button is a UI component in Android which is used to navigate between different screens. With the help of a button, the user can interact with your app and perform multiple actions inside your a 3 min read Linkify in Android using Jetpack Compose Linkify Class in Android Operating System is used to create user-clickable links from the Text on the basis of pattern matching and regex. In simple words, Linkify observes the text, finds out if a span or whole text is a type of pattern, and converts it into a clickable link. For example, if the te 3 min read Scaffold in Android using Jetpack Compose Scaffold in Android Jetpack is a composable function that provides a basic structure of the layout. It holds together different parts of the UI elements such as Application bars, floating action buttons, etc.There are a lot of apps that contain TopAppBar, Drawer, Floating Action Button, BottomAppBar 3 min read Like