BluetoothAdmin allows you to administrate the Bluetooth adapter. Using this object you can enable or disable the adapter, monitor its state and discover devices in range. DiscoveryStarted and DiscoveryFinished events are raised when a discovery process starts or finishes. StateChanged event is raised whenever the adapter state changes. The new state and the previous state are passed. The values correspond to the STATE_xxxx constants. DeviceFound event is raised when a device is discovered. The device name and mac address are passed.
The Serial library allows you to connect with other Bluetooth devices using RFCOMM, also named virtual serial port. This library requires Android 2.0 (API level 5) or above. The Serial object should be declared as a process global object. After initializing the object you can connect to other devices by calling Connect with the target device MAC address. This can be done by first getting the paired devices map. This map contains the friendly name and address of each paired device. To allow other devices to connect to your device you should call Listen. When a connection is established the Connected event will be raised. There is no problem with both listening to connections and trying to connect to a different device (this allows you to use the same application on two devices without defining a server and client). A Serial object can handle a single connection. If a new connection is established, it will replace the previous one. See this tutorial for more information.