Giter Site home page Giter Site logo

webviewbridge's Introduction

WebviewBridge

WebviewBridge (android) h5 angular。(ionic) 这是Hybird实现的一个demo 集成angular.js主要是ionic框架下面的-----感谢ionic团队的付出 主要实现H5端和native相互通信。可以实现js调不同native方法并返回,native调向js通信。

写这个初衷ionic里面cordova库比较分散,累赘,不太适合原生为主Hybird APP开发,所以自己花了几天稍微写了下 当然以H5主体Hybird APP 用ionic已经很好了,插件库也很完善,学习人也挺多。

自己有空时候整理的demo: 主要实现原理 @Override public final boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) { result.confirm(); JsCallJava.newInstance().call(view,message); return true; }

这个方法监听 win.prompt(uri, "");
addJavascriptInterface(Object obj,String interfaceName)原有大都是靠这个实现,这个有注入漏洞,不安全,不过这个在api16以上已经修复。
01.项目连接 (@作者bears111)

webviewbridge's People

Contributors

bears111 avatar

Stargazers

 avatar Camera Man avatar  avatar Ya Hui Liang avatar  avatar

Watchers

Ya Hui Liang avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.