<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Android-enable notification client side, CCCD &amp;amp; UUID.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17785/android-enable-notification-client-side-cccd-uuid</link><description>Hi All, 
 I have a problem to enable notification on my Android phone, i followed the tutorial on android web page (section bluetooth low energy) but my app crash, i have this error : 
 W/BluetoothGatt: Unhandled exception in callback
 java.lang.NullPointerException</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Jul 2019 08:35:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17785/android-enable-notification-client-side-cccd-uuid" /><item><title>RE: Android-enable notification client side, CCCD &amp; UUID.</title><link>https://devzone.nordicsemi.com/thread/200689?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 08:35:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f869ff8-47ee-4716-b8f2-4de492f09687</guid><dc:creator>Parita</dc:creator><description>[quote userid="8863" url="~/f/nordic-q-a/17785/android-enable-notification-client-side-cccd-uuid"]BATTERY_LEVEL_CHARACTERISTIC_UUID[/quote]
&lt;p&gt;Can anyone describe what will be this and how to get this&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android-enable notification client side, CCCD &amp; UUID.</title><link>https://devzone.nordicsemi.com/thread/68520?ContentTypeID=1</link><pubDate>Wed, 24 May 2017 10:18:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13520430-645f-4664-98fc-b4b4064140cb</guid><dc:creator>Pradeesh</dc:creator><description>&lt;p&gt;BluetoothGattCharacteristic chars = getCharacteristic(uuidToEnableNotification);
mBluetoothGatt.setCharacteristicNotification(chars, true);
BluetoothGattDescriptor descriptor = chars.getDescriptor(CCCD_UUID);
descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
Log.d(&amp;quot;check&amp;quot;, descriptor.getValue().toString());
mBluetoothGatt.writeDescriptor(descriptor);&lt;/p&gt;
&lt;p&gt;no error and notification is also not sent properly&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android-enable notification client side, CCCD &amp; UUID.</title><link>https://devzone.nordicsemi.com/thread/68519?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 13:41:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f97e9e8-021d-4f2a-873c-9cf483ddb283</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;There are 128-bit representation for 16-bit UUIDs and I think, the Android API can cope just with 128-bit UUIDs (but I might be wrong).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android-enable notification client side, CCCD &amp; UUID.</title><link>https://devzone.nordicsemi.com/thread/68516?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 13:36:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b123925b-6ce7-4847-82ec-d4c76ec6710d</guid><dc:creator>Yacire</dc:creator><description>&lt;p&gt;It works,
Thanks for your help Torsten.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android-enable notification client side, CCCD &amp; UUID.</title><link>https://devzone.nordicsemi.com/thread/68515?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 13:33:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4340826-5804-4dae-94eb-1e8aa4f29a6a</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;The UUID should be 0x2902.:&lt;/p&gt;
&lt;p&gt;here some code-snippets from an android project:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static final private UUID CCCD_ID = UUID.fromString(&amp;quot;000002902-0000-1000-8000-00805f9b34fb&amp;quot;);
final BluetoothGattDescriptor cccd = rccp_char.getDescriptor(CCCD_ID);
cccd.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;HTH&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android-enable notification client side, CCCD &amp; UUID.</title><link>https://devzone.nordicsemi.com/thread/68518?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 13:27:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8524d11-9648-46f5-82f9-5820c96f1f53</guid><dc:creator>Yacire</dc:creator><description>&lt;p&gt;Hi Torsten,&lt;/p&gt;
&lt;p&gt;Thanks for your answer.
There is already a CCCD in my server.The code in the server side is OK, i tested it with nrfConnect.
But when i test with my Android App, it doesn&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;What is this 16-bit UUID for CCCD ? maybe this is this UUID which is needed in this function :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bluetoothGattCharacteristic.getDescriptor( UUID.fromString(here_16bit_UUID_for_All_CCCD));
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Edit_1: Ok, in the excellent tutorial by Martin Bors-Lind, he speaks about a UUID for all CCCD :
the 16_bit value is : 0x2902.&lt;/p&gt;
&lt;p&gt;I will test with this value int the getDescriptor() method.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android-enable notification client side, CCCD &amp; UUID.</title><link>https://devzone.nordicsemi.com/thread/68517?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 12:59:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3c345e1-e700-43b0-823b-7ed900bce97d</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Not all characteristics have a CCCD by default. You have to make sure, that the GATT server provides a CCCD for the characteristic. If you have a ble sniffer, you could go and watch the service and characteristic discovery between client and server and see, if there is a CCCD and if the correct attribute bits are set within the characteristic descriptor.&lt;/p&gt;
&lt;p&gt;You can not address a specific CCCD by UUID, as all CCCD have the very same 16-bit UUID. You have to lookup the characteristic, that contains the CCCD and then search through all attributes of that characteristic. But that is something that should have been done by Android for you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>