JsBridge is an Android library that creates a communication bridge between Java code and JavaScript running inside a WebView. It was inspired by WebViewJavascriptBridge and the bridge approach used by WeChat. JavaScript can call registered Java handlers, while Java code can invoke JavaScript handlers and receive callback responses. Its BridgeWebView class extends the standard Android WebView to package the communication layer into a reusable component. The API is designed to make hybrid Android applications easier to structure and maintain. Its behavior also resembles bridge implementations available on iOS, which helps teams design similar web-to-native interfaces across platforms. The project is distributed under the MIT license and can be included through JitPack.
Features
- Bidirectional Java and JavaScript communication
- WebView-based bridge architecture
- Named handler registration
- Callback-based responses
- BridgeWebView Android component
- Cross-platform bridge-style API design