• Stars
    star
    197
  • Rank 197,722 (Top 4 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Companion project for the Punch Through blog post "The Ultimate Guide to Android Bluetooth Low Energy"

Punch Through Android BLE Starter App

Note: This project is currently up-to-date as of compileSdkVersion and targetSdkVersion of 30 (Android 11). We're working on support for Android 12+ as part of #14.


CircleCI build status

Companion Android app project for Punch Through's "Ultimate Guide to Android BLE Development" blog post for beginners, with examples of how to perform basic BLE operations and some Android BLE tips and tricks on the following:

  • Scanning for nearby BLE devices
  • Connecting to BLE devices
  • Discovering services and characteristics
  • Requesting an ATT MTU update
  • Reading and writing data on characteristics and descriptors
  • Enabling and disabling notifications and indications on characteristics
  • Bonding with a BLE device
  • Implementing your own BLE operations serial queuing mechanism

Setup

  1. Clone the project to your directory of choice.
git clone https://github.com/PunchThrough/ble-starter-android.git
  1. Launch Android Studio and select "Open an existing Android Studio project".
  2. Navigate to the directory where you cloned the project to, and double click on it.
  3. Wait for Gradle sync to complete.

Requirements

This project targets Android 10 and has a min SDK requirement of 21 (Android 5.0), in line with our recommendation in 4 Tips to Make Android BLE Actually Work.

Contributing

Reporting bugs

Please open an issue to report a bug if the app isn't behaving as expected.

Opening a Pull Request

Please fork the repository and create a feature branch before opening a Pull Request against the master branch.

Linting and code style

The project uses Kotlin's default coding conventions and includes the .idea/codeStyle directory in source control. The project also runs ktlint as part of the CI process to ensure code consistency.

You may run ktlint locally using the following command:

./gradlew ktlint

Some simpler violations can be automatically formatted by ktlint using the following command:

./gradlew ktlintFormat

Licensing

This project is licensed under the Apache 2.0. For more details, please see LICENSE.

More Repositories

1

Bean-iOS-OSX-SDK

Punch Through's SDK for speeding up development with the LightBlue Bean development platform
Objective-C
173
star
2

bean-sdk-android

Official Light Blue Bean SDK for Android by Punch Through
Java
59
star
3

Zombeacon

An Interactive Demo of Infectious New Tech
Objective-C
53
star
4

espresso-ble

Python
45
star
5

bean-arduino-core

Arduino Firmware, Installation Files and Examples for the LightBlue Bean project.
C++
44
star
6

CodeViewEditor-iOS

Objective-C
35
star
7

bean-sdk-node

Official cross-platform Bean SDK by Punch Through, written in Node.js.
JavaScript
26
star
8

node-red-contrib-bean

Node-Red nodes for the LightBlue Bean
JavaScript
23
star
9

BeanSurfMap

pulls the surf report using python and Surfline's API, pushes over BLE to the Bean, which displays it on a canvas surf map, using Neopixel LED arrays
Arduino
20
star
10

bean-documentation

Documentation on various protocols used by the LightBlue Bean.
19
star
11

Bean-LightBlueLatch

Using the Bean to control an electronic deadbolt over BLE.
Arduino
11
star
12

DataLogger

Example sketch that shows you how to log data on an SD card using the LightBlue Bean
Arduino
10
star
13

bean-app-ios-blink

Sample iOS app that lets an LED Blink when a button is pressed.
Swift
7
star
14

FacebookFlagger

Use the Bean to Receive facebook / twitter notifications and move a servo mounted flag accordingly.
Python
7
star
15

Arduino-IDE-examples

Example sketches in the Arduino IDE
Arduino
7
star
16

list-beacons

List iBeacons near you.
JavaScript
6
star
17

bean-serial-protocol

Bean serial message definitions
C
6
star
18

bean-app-ios-ibeacon-demo

Search for nearby iBeacons with your iOS device.
Swift
6
star
19

bean-cloud-compiler-libraries

Cloud compiler libraries that are not shipped with the bean-arduino-core
C++
4
star
20

bean-docs

JavaScript
3
star
21

Near

Swift
3
star
22

blog-ios-resigning-script

Script to go with the blog post "Why Re-Signing iOS Apps is Better than Recompiling"
Shell
2
star
23

BeanCameraRemote

Bean demo camera app using button to take pictures remotely
Objective-C
2
star
24

Play-Audio-From-SD-Card

Arduino
1
star
25

ukulele

Arduino
1
star
26

ble-starter-ios

1
star