opened, it determines if Bluetooth is supported by the device, as well as whether or not
Bluetooth is enabled. After this, it finds the Arduino’s Bluetooth module paired with the Android
and uses it to form a connection. This connection process creates a socket that both devices will
use to receive and transmit data. When the Android sends the Arduino a “*” character, the
Arduino sends back a random number between 0 and 999, followed by a “#” character. The
Android parses the incoming data and stores only the number portion in a string called
writemessage. Thus, data transmission using Bluetooth is achieved.