Giter VIP home page Giter VIP logo

androidusbconnector's Introduction

AndroidUSBConnector

AndroidUSBConnector is a abstracted code and sample code about connection between host PC and Android target device. It is composed of host client and Android server app. It uses ADB for USB communication additionally.

Why Abstraction?

ADB's port-forwarding function allows host PC only act as client, not server. In this reason, sending a message from host PC to client is easy to implement, but the reverse is not. AndroidUSBConnector allows both host PC and target Android device listen and send messages each other. It also makes sensing target device's connection easier.

Components

  • Sample client: GUI application running on host PC (it uses swing)
  • Sample server: Android application

Prerequisite

  • ADB binary on host PC
  • JDK/JRE on host PC

How to use it in your code

You can pick USBConnector and ADBConnector and use it in your code. As you can see in this sample, server on target device uses only USBConnector, and client on host PC uses both USBConnector and ADBConnector. ADBConnector senses connection with target device and opens a port to target device through ADB's port-forwarding function.

Watch out!

  • Due to limitation of ADB port-forwarding, server can get messages from client by only polling. You should send a dummy message to client periodically for getting messages from client.
  • Send buffers of USBConnectors stores messages and USBConnectors send messages in one string which can be split by '\n'. Splitting messages is your charge. You can change this split character.

androidusbconnector's People

Contributors

redcarrottt avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

bileljegham

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.