Start here
Edit index.html to build your app. This page already handles safe areas, dark mode and the app bridge.
App bridge
In the built app, window.WebToApk gives this page native features. Check that it exists before you call it, so the page also works in a normal browser.