Android bluetooth API: control on SDP record

1,425 views
Skip to first unread message

Asad

unread,
Jun 20, 2011, 1:26:01 PM6/20/11
to android-platform, shah.asa...@gmail.com
Hi,

I am implementing bluetooth based communication protocol to be used
across different platforms, including Android. I chose to use a Serial
Port Profile based data pipe, as almost all platforms support this
profile.

For Android, I use the 'listenUsingRfcommWithServiceRecord(name,
UUID)' and 'createRfcommSocketToServicerecord(UUID)' APIs.

Now, when I create the Rfcomm server socket, apparently, Android puts
the 128-bit UUID in the Service-class ID in the SDP record.

I want my service to be identified as a standard serial port service
(according to service class id), and also, I want to give my service a
unique ID (most probably service-id), that would allow the clients to
identify this particular app.

Apparently android does not allow full control over the SDP record.

With the abovementioned API, I can get my service to be identified as
a standard serial port service, by using
the UUID = (0x1101 | BASE_UUID) = 00001101-0000-1000-8000-00805F9B34FB

Then my other purpose, to get a unique id for the app is not served.

With bluez, I could create a service-class id list as well as a
service Id. But android API does not allow this.

Is there any work-around for this problem?

Thanks
Asad

Jaikumar Ganesh

unread,
Jun 22, 2011, 12:45:47 PM6/22/11
to android-...@googlegroups.com, shah.asa...@gmail.com
It depends on what you are trying to do. If you are writing an app,
there is no Android API level workaround for this. If you are
interested, you can contribute a patch at review.source.android.com.

If its just for development or hacking purposes you can directly talk
to Bluez stack to add the SDP record. Note, not all Android phones use
Bluez stack.

> --
> You received this message because you are subscribed to the Google Groups "android-platform" group.
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
>
>

krishna chaitanya

unread,
Jun 23, 2011, 1:18:53 AM6/23/11
to android-platform
Hi Jai,

Can you please mention what are the other bluetooth stacks used in
android phones if not Bluez. Till now I know that it is the only stack
that is used for bluetooth. I havent seen any oher stack in any build
apart from BlueZ.

Thanks,
Krishna Chaitanya.

Jaikumar Ganesh

unread,
Jun 23, 2011, 11:28:25 AM6/23/11
to android-...@googlegroups.com
A partial list includes Broadcomm, CSR, Marvell, TI, StonestreetOne etc.

It depends on the phone you are using.

Pavan Savoy

unread,
Jun 23, 2011, 11:46:55 AM6/23/11
to android-...@googlegroups.com
On Thu, Jun 23, 2011 at 10:28 AM, Jaikumar Ganesh <jaik...@gmail.com> wrote:
> A partial list includes Broadcomm, CSR, Marvell, TI, StonestreetOne etc.
>
> It depends on the phone you are using.

So, they wouldn't have bothered to expose org.bluez.Service kind of
objects would they ?
With a phone how do I ensure all the APIs for bluetooth exposed by
android actually work ? Is it left for the phone makers
to decide whether to support them or not ?

Shouldn't it be moderated for ease of App developers? (Currently in
this situation this would be hypothetical, since the App API doesn't
exist)


> On Wed, Jun 22, 2011 at 10:18 PM, krishna chaitanya
> <krishnacha...@gmail.com> wrote:
>> Hi Jai,
>>
>> Can you please mention what are the other bluetooth stacks used in
>> android phones if not Bluez. Till now I know that it is the only stack
>> that is used for bluetooth. I havent seen any oher stack in any build
>> apart from BlueZ.
>>
>> Thanks,
>> Krishna Chaitanya.
>>
>> --
>> You received this message because you are subscribed to the Google Groups "android-platform" group.
>> To post to this group, send email to android-...@googlegroups.com.
>> To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
>> For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups "android-platform" group.
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
>
>

--
--Pavan Savoy

Jaikumar Ganesh

unread,
Jun 23, 2011, 12:02:03 PM6/23/11
to android-...@googlegroups.com
http://source.android.com/compatibility/overview.html is the answer for it.

All the Android public APIs are supposed to work if a phone passes the
Compatibility requirements.

Reply all
Reply to author
Forward
0 new messages