I believe that I can do the pairing and authentication with:
RemoteDevice rd = new RemoteDevice("<mac>");
RemoteDeviceHelper.authenticate(rd, "<pin>");
But then how do I use that "rd" object to open a (serial) connection to my bluetooth device?
Doing this afterwards:
StreamConnection conn = (StreamConnection) Connector.open("btspp://<mac>:1;authenticate=true;encrypt=true;master=false;"
returns a "connection refused" message, which is why I think I need to use the RemoteDevice object somehow.