GithubHelp home page GithubHelp logo

ble-visual's Introduction

BLE Visual

Android provides native support for Bluetooth Low Energy.
This is a sample app which can make a BLE connection to a device and visualize the data of a 4x4 sensor array on the device in the form of colored bubbles in real-time.

Data Reading: Low-Medium-High
Bubble Color: Blue-Purpe-Red
Bubble Size: Small-Medium-Large

The app is designed with two swipable tabs. First tab displays connection information while the second displays the sensor map. There is floating action button to initiate scan for devices. The app currently scans for maximum of 20 seconds to locate a device. When connected to a device, the sensor map updates in real time. In order to disconnect from the device, use the options menu.

BLE logic flow

  1. Scan
  2. Connect
  3. Discover services
  4. Request MTU
  5. Set characteristic notification
  6. Write to client configuration descriptor
  7. Read data from characteristic

Note: This flow can be customized depending on the use case and device parameters.
Some Android devices have a default MTU limit of 20 bytes hence, it is better to request for increased MTU for successful readings.

Requirements: In order to run the app for this niche use case, enter custom UUIDs and Device Name in the Constants file. Otherwise the app runs using dummy UUIDs and empty Device Name.

Here are some sample screenshots of app workflow including sample sensor maps with all low, all high and random data values.





Future TODOs

  1. UI improvements
  2. Display more device information
  3. Populate settings for app
  4. Cleaner segregated code for MainActivity and BLEService
  5. Generic logic for BLEService
  6. Performance optimization
  7. Unit tests
  8. Generic BLE connection library

Resources

  1. Android Developer Guide to BLE
  2. BLE Beginner's Tutorial
  3. Android Bluetooth GATT API
  4. Bluetooth specifications guide

ble-visual's People

Contributors

shrreya 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.