You can't specify a port number using the Public API. Doing so is a really bad idea, because it encourages developers to hardcode one of the limited (30) set of RFCOMM port numbers.
Try reading the API documentation to see how a UUID is used to look up a port number by SDP record. If you are not connecting to an Android remote device, then you will want to make sure the remote device advertises a simple SDP record with a UUID and port number. Then you can specify that UUID in Android and it will automatically look up the port number for you. Nick On Mon, Nov 16, 2009 at 10:15 AM, Sean Liao <[email protected]> wrote: > Hi, > I am trying to port an existing mobile application to android 2.0 platform. > In this application, we need to connect to remote device specify two > parameters: 1.) radio address of the remote devices, and 2.) a > port/channel number. (for microsoft c++ sdk, only radio address) > I found createRfcommSocketToServiceRecord (UUID uuid) is provided in the new > Android bluetooth SDK, and wondering am I able to use it to do the same > thing. If so, how do I specify the UUID object given a radio address and > port number? > ================================================ > The following is an example of J2me/Jsr82 to establish SPP connection. > // where 001122334455 is the radio address. 1 is the port number. > String url = > "btspp://001122334455:1;authenticate=false;encrypt=false;master=false"; > // JSR120 use JCA framework > Connector.open(url, READ_WRITE, true); > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

