WebView
Dependencies
Section titled “Dependencies”implementation("androidx.webkit:webkit:1.8.0")View for Local HTML File
Section titled “View for Local HTML File”In project explorer under main/assets add a HTML file, then use loadUrl("file:///android_asset/...") to locate it.
NOTE:
file:///android_assetpoints tomain/assets
AndroidView(factory = { WebView(it).apply { layoutParams = ViewGroup.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, // for style width and height ViewGroup.LayoutParams.MATCH_PARENT ) }}, update = { it.loadUrl(<file-path or web url>)})View for Web URL
Section titled “View for Web URL”To access the internet, enable the permission in AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />