INTERNET permission, put a full-screen WebView in MainActivity.kt with JavaScript and DOM storage on, handle the back button and external links, then use Build → Generate Signed App Bundle / APK. Or skip all of it: the free converter builds the same app in five minutes.1. Create the project
Install Android Studio, then File → New → New Project → Empty Views Activity. Choose Kotlin and a minimum SDK of 24 (Android 7.0) — that covers well over 95% of active devices. Set the package name now; it's permanent once you publish (try the code generator to pick one).
2. AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<application
android:label="My App"
android:icon="@mipmap/ic_launcher"
android:theme="@style/Theme.Material3.DayNight.NoActionBar">
<activity
android:name=".MainActivity"
android:exported="true"
android:configChanges="orientation|screenSize|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
configChanges stops Android from reloading the page when the phone rotates.
3. MainActivity.kt
class MainActivity : AppCompatActivity() {
private lateinit var web: WebView
private val home = "https://example.com/"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
web = WebView(this)
setContentView(web)
web.settings.apply {
javaScriptEnabled = true
domStorageEnabled = true // localStorage, needed by most sites
loadWithOverviewMode = true
useWideViewPort = true
}
web.webViewClient = object : WebViewClient() {
override fun shouldOverrideUrlLoading(v: WebView, r: WebResourceRequest): Boolean {
val url = r.url
if (url.host == Uri.parse(home).host) return false // stay in the app
startActivity(Intent(Intent.ACTION_VIEW, url)) // tel:, mailto:, other sites
return true
}
}
onBackPressedDispatcher.addCallback(this) {
if (web.canGoBack()) web.goBack() else finish()
}
if (savedInstanceState == null) web.loadUrl(home) else web.restoreState(savedInstanceState)
}
override fun onSaveInstanceState(out: Bundle) {
super.onSaveInstanceState(out)
web.saveState(out)
}
}
Wrap startActivity in a try/catch for ActivityNotFoundException if you link to schemes the phone might not handle.
4. File uploads, camera and downloads
A WebView ignores <input type="file"> until you implement WebChromeClient.onShowFileChooser and return the picked file through the callback — use registerForActivityResult(ActivityResultContracts.GetMultipleContents()). Downloads need a DownloadListener that hands the URL to DownloadManager. Geolocation needs onGeolocationPermissionsShowPrompt plus the runtime location permission. This is the part that usually takes longest — and it's all built into the no-code converter.
5. Bundle files instead of a URL (optional)
Put your site in app/src/main/assets/www/ and serve it with WebViewAssetLoader so it loads from https://appassets.androidplatform.net/assets/www/index.html. Avoid file:// URLs — ES modules and fetch are blocked there.
6. Sign and build
- Build → Generate Signed App Bundle / APK.
- Choose Android App Bundle for Google Play or APK to share directly.
- Create a new keystore. Back it up — lose it and you can't ship updates (unless you use Play App Signing).
- Pick the release build variant and finish. The file lands in
app/release/.
DIY vs converter
| Android Studio | Web to App Creator | |
|---|---|---|
| Time to first APK | 2–6 hours | About 5 minutes |
| Needs a computer | Yes (8 GB+ RAM) | No |
| Uploads, camera, downloads, offline screen | Write it yourself | Built in |
| Full code control | Yes | Settings only |
| Cost | Free | Free APK · $5/mo for AAB |
Create your app now — free
No watermark, no card, no Android Studio. Pick what you're starting from:
Frequently asked questions
How do I convert a website to APK in Android Studio?
Create an Empty Views Activity project, add the INTERNET permission, load your URL in a WebView with JavaScript and DOM storage enabled, handle the back button, then generate a signed APK or App Bundle.
Is WebView code allowed on Google Play?
Yes. Make sure the app adds value, targets a current API level and doesn't load other people's content.
Why do file uploads not work in my WebView app?
WebView doesn't open a file picker by itself. Implement WebChromeClient.onShowFileChooser and pass the selected file back through the callback.
Should I use Java or Kotlin?
Kotlin is Google's recommended language for new Android apps, and every example in the docs uses it. The WebView API is the same in both.
Can I get this code without writing it?
Yes — the WebView app code generator fills in your URL, package name and options and gives you copy-ready files.