Android Question Best way to communicate between B4A and WebView JavaScript?

davidanderson

New Member
Hi everyone,

I'm building a simple B4A app that loads an HTML5 game inside a WebView.

The game runs well, but I'd like the JavaScript side to notify the native app whenever certain actions happen (for example, button presses), so I can trigger vibration or other native features.

At the moment I'm looking at WebViewExtras, but I'm not sure if that's still the recommended approach for newer Android versions (Android 13/14), or if there's a better solution available.

Has anyone implemented reliable communication between JavaScript and B4A recently?

Any examples or recommendations would be appreciated.

Thanks!
 
Top