GithubHelp home page GithubHelp logo

kymjs / faraday Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 105 KB

A set of perfect H5 hybrid jsbridge solution of Android

Home Page: https://kymjs.com/

Java 75.38% JavaScript 19.71% HTML 4.91%
jssdk hybrid android

faraday's Introduction

OSL

Faraday

中文文档

A set of perfect H5 hybrid jsbridge solution of Android, which is simple and convenient for development and debugging

  • Compatible with Android 12

  • Support androidx package

  • No privacy related issues

Getting Started

latest version numbers:

// root build.gradle
allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

// module build.gradle
dependencies {
    implementation 'com.github.kymjs:faraday:2.0.0'
}

register JSBridge

FaradayBridge.getInstance().register(new DemoBridge());

customs WebView

public class InjectedChromeClient extends WebChromeClient {
    @Override
    public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
      //  只需要在 onJsPrompt 方法中通知Faraday即可
      result.confirm(FaradayBridge.getInstance().call(view, message));
        return true;
    }
}

native call js

使用简单,且方便自定义封装,对 H5 侧开发更直观

webview.loadUrl("javascript://window.hello()");

Requirements

Faraday can be included in any Android application.

Faraday supports Android 4.0, API14 (HONEYCOMB_MR1) and later.

License

Licensed under the Apache License Version 2.0. The "License"

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.