This library is based on Tom Igoe’s Btserial library, and his support.
The usage of this library is quite similar to that on PC/MAC. In this preliminary version, it will connect according the given number in its construction function. And connect to the paired device in the cell phone’s list according to the number. The rest is the same.
There are three things to mention:
Remember to put a copy of the library’s jar file to the sketch’s code folder.
Set the permissions to give the sketch the chance to access to the Bluetooth.
Another problem is that the Android application will reset when it detects rotation. This may make the program a mess. Add “android:screenOrientation=”portrait”” in activity tag will disable this function.
Works well on my $100 phone (no contract, android 2.2).