Git Product home page Git Product logo

com.qqlittleice.ironbridge's Introduction

Ironbridge Api

Ironbridge Api is used to interact with the Ironbridge Xposed module.

Features

  • Connect to the public bridge, send and receive content
  • Connect to the custom bridge, send and receive content (TODO)

Quick Start

1. Install Ironbridge Xposed module

2. Connect to the public bridge

// Java
Ironbridge bridge = IronBridge.getPublicBridge();
// attention: bridge may be null if the public bridge is not available
// always check if bridge is null after calling getPublicBridge()
if (bridge != null) {
    // do something
}
// Kotlin
val bridge = IronBridge.getPublicBridge()
// attention: bridge may be null if the public bridge is not available
// always check if bridge is null after calling getPublicBridge()
bridge?.let {
    // do something
}

3. Send content to the bridge

// Java
bridge.sendBoolean(
        "main", // the channel
        "a boolean value", // the key
        true // the value
        );
// ......
// Kotlin
bridge.sendBoolean(
        "main", // the channel
        "a boolean value", // the key
        true // the value
        )
// ......

current supported types:

  • String

  • int

  • long

  • float

  • double

  • boolean

  • List

    • String

    • Integer

    • Long

    • Float

    • Double

    • Boolean

  • Array

    • int

    • long

    • float

    • double

    • boolean

  • Parcelable (Make sure all clients have the same class)

  • Serializable (Make sure all clients have the same class)

  • IBinder

4. Receive content from the bridge

// Java
ironbridge.addListener(new BridgeListener.Stub() {
    @Override
    public void onReceivedString(String key, String value) {
        // do something
    }
    
    // ......

    @Override
    public String getChannel() {
        // return the channel name that the channel you want to listen
        return "main";
    }
});
// Kotlin
bridge?.addListener(object: BridgeListener.Stub() {
    override fun onReceivedString(key: String?, value: String?) {
        // do something
    }

    // ......
    
    override fun getChannel(): String {
        // return the channel name that the channel you want to listen
        return "main"
    }
})

com.qqlittleice.ironbridge's People

Stargazers

 avatar

Watchers

 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.