Is it possible to interact with a webview in android trough my native android code?
I develop can bus driver for android and I like to send my can bus data to a html 5 app in a webview without sending them over internet to a webservice. or is it possible to call funktions via the html 5 app in my native android app?
Do you know a good solution for that scenario?
2.1 To receive data from webview ,we can create an interface, which will enable webview to connect the native layer and pass data. From native layer, create a class and replicate the following. While configuring web view, we need to set JavaScript interface as above JSBridge class.
Alternatives to WebView If you want to send users to a mobile site, build a progressive web app (PWA). If you want to display third-party web content, send an intent to installed web browsers. If you want to avoid leaving your app to open the browser, or if you want to customize the browser's UI, use Custom Tabs.
This interface was deprecated in API level 12. This interface is now obsolete.
Check out addJavascriptInterface
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With