All Projects → mapleqin → WebViewJavascriptBridge

mapleqin / WebViewJavascriptBridge

Licence: Apache-2.0 license
This is a communication between Android applications and Web Javascript to establish a bridge between the call support each other

Programming Languages

java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to WebViewJavascriptBridge

FMWebViewJavascriptBridge
FMWebViewJavascriptBridge inspired by WebViewJavascripBridge and react native
Stars: ✭ 29 (+81.25%)
Mutual labels:  bridge, webviewjavascriptbridge
ansible-config-interfaces
No description or website provided.
Stars: ✭ 28 (+75%)
Mutual labels:  bridge
Polycube
eBPF/XDP-based software framework for fast network services running in the Linux kernel.
Stars: ✭ 217 (+1256.25%)
Mutual labels:  bridge
Retyped
Access 3600+ libraries from C# and let Bridge.NET compile your project into JavaScript.
Stars: ✭ 216 (+1250%)
Mutual labels:  bridge
Doctrine Bridge
Provides integration for Doctrine with various Symfony components.
Stars: ✭ 2,800 (+17400%)
Mutual labels:  bridge
rn-webview-rpc
Add RPC capabilities to a React Native WebView component
Stars: ✭ 25 (+56.25%)
Mutual labels:  bridge
critter
Chat bot relaying messages between IRC and Gitter
Stars: ✭ 16 (+0%)
Mutual labels:  bridge
Websockify
Websockify is a WebSocket to TCP proxy/bridge. This allows a browser to connect to any application/server/service.
Stars: ✭ 2,942 (+18287.5%)
Mutual labels:  bridge
JsBridge-WebViewJavascriptBridge-Sample
iOS JsBridge Solution by WebViewJavascriptBridge
Stars: ✭ 16 (+0%)
Mutual labels:  webviewjavascriptbridge
poa-bridge
POA <-> Ethereum bridge for self transfers of POA native token to POA20 (ERC20 representation). Not supported. Use TokenBridge instead
Stars: ✭ 75 (+368.75%)
Mutual labels:  bridge
Rubypython
An in-process between Ruby and Python. Soon changing repo address.
Stars: ✭ 246 (+1437.5%)
Mutual labels:  bridge
Gdbghidra
gdbghidra - a visual bridge between a GDB session and GHIDRA
Stars: ✭ 251 (+1468.75%)
Mutual labels:  bridge
onionfruit
OnionFruit™ Connect - Tor access client with country selection, bridge configuration, pluggable transports and experimental DNS support
Stars: ✭ 150 (+837.5%)
Mutual labels:  bridge
Miscord
Facebook Messenger to Discord bridge
Stars: ✭ 225 (+1306.25%)
Mutual labels:  bridge
matrix-sms-bridge
Matrix bridge, that allows you to bridge matrix rooms to SMS with one telephone number only.
Stars: ✭ 62 (+287.5%)
Mutual labels:  bridge
Hackpi
Hacking tool inside a Raspberry Pi zero
Stars: ✭ 218 (+1262.5%)
Mutual labels:  bridge
app-xyo-nodejs
XYO Archivist/Diviner CLI
Stars: ✭ 41 (+156.25%)
Mutual labels:  bridge
ligh7hau5
A Matrix (https://matrix.org/docs/spec/) to Fediverse / ActivityPub client / bridge. Also, some media proxying.
Stars: ✭ 26 (+62.5%)
Mutual labels:  bridge
unity-bridge-ui-framework
🏝 a little framework base on unity and ugui,we use bridges to connect one panel to another panel
Stars: ✭ 90 (+462.5%)
Mutual labels:  bridge
WormHole
WormHole allows to share classes between Flutter and Native Platform (android / ios)
Stars: ✭ 36 (+125%)
Mutual labels:  bridge

WebViewJavascriptBridge

This is a communication between Android applications and Web Javascript to establish a bridge between the call support each other

WebViewJavascriptBridge for Android Implement!

JavaScript

function setupWebViewJavascriptBridge(callback) {
    if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); }
    if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); }
    window.WVJBCallbacks = [callback];
    var WVJBIframe = document.createElement('iframe');
    WVJBIframe.style.display = 'none';
    WVJBIframe.src = 'wvjbscheme://__BRIDGE_LOADED__';
    document.documentElement.appendChild(WVJBIframe);
    setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0)
}

Sample

setupWebViewJavascriptBridge(function(bridge) {

    /* Initialize your app here */
    bridge.registerHandler('callJs', function(data, responseCallback) {
        console.log(data);
        responseCallback('callback:');
    })

    bridge.callHandler('callNative', "{\"callNativeData\":\"data\"}",function(data){
        console.log(data);
    })
})
WJBridgeWebView webVuew = new WJBridgeWebView(context);

webView.registerHandler("callNative", new WJBridgeHandler() {
        @Override
        public void handler(String data, WJCallbacks callbacks) {
            Toast.makeText(getApplicationContext(),data,Toast.LENGTH_SHORT).show();
            callbacks.onCallback("callNative response data" + System.currentTimeMillis());
        }
    });

webView.callHandler("callJs", "{\"callJsData\":\"data\"}", new WJCallbacks() {
        @Override
        public void onCallback(String data) {
            Toast.makeText(getApplicationContext(),"callJs callback" + data,Toast.LENGTH_SHORT).show();
        }
    });

Gradle Download

compile 'org.amphiaraus.webkit:jsbridge:[version]'

QQBrowser X5 core Download

compile 'org.amphiaraus.webkit:jsbridge-qqx5tbs:[version]'

Developed by

Amphiaraus - [email protected]

License

Copyright 2015 The Android Open Source Project for WebViewJavascriptBridge

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].