Skip to content

jose-a-rodrigues-alb/AndroidBluetoothClient

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Android Bluetooth Client

This repository provides an Android app with reusable code for running a socket client over Bluetooth. The code derives from the term projects of four students in Washington and Lee's Spring 2018 course CSCI 251: Android App Development. The students originally wrote code to control a servo connected to a RaspberryPi 3, which acted as the server. Eventually I was able to factor this code into three reusable classes
  • DeviceListActivity: the main (first) activity of your app. It lists the Bluetooth devices with which your Android device is paired and connects to the device you select.

  • CommunicationsTask: an asynchronous task (i.e., thread) for managing communications with the device to which you've connected.

  • CommunicationsActivity: an abstract class that supports reading from and writing to the server via its mBluetoothConnection object.

An example subclass, MyCommunicationsActivity, provides a seek-bar (slider) and text widget to send and receive values from your server.

Python server

The easiest way to try out this app is with the Python Bluetooth server that we developed to work with it. This server uses the same simple protocol (period-delimited messages) as the code in the MyCommunicationsActivity class.

About

Simple Bluetooth socket client for Android

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%