GithubHelp home page GithubHelp logo

androidbluetooth's Introduction

Android Bluetooth

How to install

Step 1: Add the JitPack maven repository to the list of repositories:

repositories {
	jcenter()
	maven { url "https://jitpack.io" }
}

Step 2: Add the dependency information:

dependencies {
	implementation 'com.github.trifork:AndroidBluetooth:1.0.0' // check the releases/tags page to find the latest version
}

How to use

Create an instance of the BluetoothManager for injection.

    BluetoothManager(
        applicationContext,
        BluetoothManager.Configuration(
            connectionMtuSize = 200, // optional
            logger = object : BluetoothManager.Logger {  // optional
                override fun v(message: String) {
                    Timber.tag(TAG).v(message) // or, your logging framework of choice
                }

                override fun d(message: String) {
                    Timber.tag(TAG).d(message)
                }

                override fun i(message: String) {
                    Timber.tag(TAG).i(message)
                }

                override fun w(message: String) {
                    Timber.tag(TAG).w(message)
                }

                override fun e(message: String) {
                    Timber.tag(TAG).e(message)
                }
            },
            hexFormatter = { bytes -> bytes.joinToString("-") { "%02x".format(it) } } // optional
        )
    )

With this instance you can:

  • start scan
  • stop scan
  • connect
  • read the rssi of a connection
  • set the priority of a connection
  • add and remove individual listeners to connections
  • enable notification for a characteristic on a connection
  • read a characteristic on a connection
  • write bytes to a characteristic on a connection

How to deploy new version

This library is distributed with using JitPack.io.

Step 1:

Go to the releases page.

Step 2:

Select "Draft a new release"

Step 3:

Set a tag version. For example v1.0.1 Select @target to be the main branch. Provide a release title, if it should not be the tag version provided.

Step 4:

Press "Publish release"

This will create a release and a corresponding tag.

๐ŸŽ‰ Hurray! It is now available to users to start using in their Android projects.

androidbluetooth's People

Contributors

jjetrifork avatar

Watchers

James Cloos avatar  avatar

Forkers

isabella232

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.