Thursday 22 May 2014

Android App: Bluetooth Macro Input

UPDATE - Please note this version of the Bluetooth Macro Input app is no longer supported. Although it's still on the Play store, it will not be updated in future. Please consider migrating to the new Bluetooth Macro and Voice Input app instead.
A while ago I posted this snippet of Arduino code for an upcoming project. Unfortunately with a looming redundancy and several courses on the go at the moment I've not had the free time to follow up until now.

All the code does is read a character from the serial pins of the arduino, then outputs that character as a keyboard keystroke using the keyboard emulation functionality of the Arduino Leonardo variants.

The rest of the hardware is very simple - just a bluetooth serial module, such as one of these - connected to those pins. There's just 4 pins - power, ground, TX and RX.

With that done, and the arduino sketch uploaded, the rest of the work is in the android application, which is now available for download by clicking the button below.

What it does
You can provide a library of snippets of text on your devices external storage (any ASCII filetype is fine), and then this app can access them, and send them via bluetooth to the arduino hardware, which emulates a USB keyboard and types the contents out.
This is handy for maintaining a library of code/command snippets that you might want to use across different computers or devices. (Or if, say, your day job requires you to often type the same thing on a computer that you have little control over software/config wise...)

  • The hardware described above.. Without it, the app is kinda pointless.
  • Supports versions of android from 2.2 (Froyo) upward, though only tested on a Samsung Galaxy S3.
  • Bluetooth serial device (115200 bps)
  • Permissions
    • Requires bluetooth and external storage access.


To run the app, first turn on bluetooth.
When you first run the app, you'll need to enter the MAC address of your bluetooth device - you should be able to find this in the docs of your serial device (or printed on it). Once done it should automatically connect.
Create or move your text snippet files to the a folder on the SD card under BluetoothMacroInput directory.
Use the Menu key in the app to bring up the menu, which is basically just the folder structure of the directory - click on your chosen file and it'll load it into the text view. Click 'Type' to have the device start typing your text.
Depending on your external hardware, you might need to adjust the delay value (if the typed text is garbled, then you need to increase the number)

Future Development plans
  • One-button input for frequently used commands.
  • Mouse emulation using phone touchscreen/sensors
  • Dynamic macro recording (using USB host passthrough for a keyboard)
  • General UI improvements..

Unfortunately I'm not in a position to offer any kind of official support for this, so use entirely at your own risk. If you have any trouble with it, then feel free to contact me on twitter/G+/leave a comment, and I'll try to help as and when I can, but I make no guarantees!

Any feedback, particularly with compatibility on different hardware (both android devices and Bluetooth/keyboard hardware) will be much appreciated.

No comments:

Post a Comment