Old code that I recently found. This was part of my thesis back in 2011.
Main pourpose here was to allow a Bluetooth connection to a Lego NXT Mindstorms and control it using an Android App as a remote control.
Basic configurations to connect, wait for connections and close connection after the session.