Connect Two Android Devices via Bluetooth

In the following sketch, we’ll work with three tabs. The main tab, BluetoothCursors, contains our usual setup and draw methods and global variables. The second tab, EnableBluetooth, contains code that is necessary to enable Bluetooth on startup, registering our Bluetooth class when the so-called Android activity is created (this step might not be necessary in future versions of Processing).[184] Processing allows us to not dive too deep into the Android application life cycle, and we’ll try to keep it that way. The third tab, called UI, contains all the code we’ll use for GUI elements like menus, an Android list to select Bluetooth devices, and the software keyboard to enter user input. When the sketch ...

Get Rapid Android Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.