<?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 - Never get notification</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14594/android---never-get-notification</link><description>Hi, 
 I&amp;#39;m writing an application to communicat on BLE with an IoT device.
I connect well, and can write on characteristic but normally I should receive notification after writing. I never get it.
But when I go through the application nRF Master Control</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 Jul 2019 13:19:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14594/android---never-get-notification" /><item><title>RE: Android - Never get notification</title><link>https://devzone.nordicsemi.com/thread/200981?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 13:19:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca17319e-d04d-4693-93bc-10b51708b329</guid><dc:creator>Parita</dc:creator><description>&lt;p&gt;getValue() is showing null value. Is there any process to get the byte value from nRF52 ble module&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android - Never get notification</title><link>https://devzone.nordicsemi.com/thread/55703?ContentTypeID=1</link><pubDate>Tue, 26 Jul 2016 11:53:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f7e5c12-b576-4f62-a30b-6c3782385941</guid><dc:creator>Christopher</dc:creator><description>&lt;p&gt;Here are the required steps to enable a characteristic notifications (very similar for indications):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Get the characteristic from the connected device:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;BluetoothGattCharacteristic char = gatt.getService(serviceUuid).getCharacteristic(charUuid);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;You should maybe check if the characteristic has a CCCD and has the notification property.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Then, enable the notifications or indications:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;gatt.setCharacteristicNotification(char, true);&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Finally, write to the CCCD to enable notifications:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;BluetoothGattDescriptor desc = char.getDescriptor(CCCD_UUID);&lt;/code&gt;
&lt;code&gt;desc.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);&lt;/code&gt;
&lt;code&gt;boolean success = gatt.writeDescriptor(desc);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;You can check the result of the GATT &lt;code&gt;writeDescriptor&lt;/code&gt; operation to be sure it has been sent. Then, you can wait for the asynchronous &lt;code&gt;onDescriptorWrite&lt;/code&gt; callback to be sure the value has been written to the remote device.&lt;/p&gt;
&lt;p&gt;Be aware that it is not possible to queue GATT operations with the Android BLE stack. If the radio/stack is busy, you must wait on the operation callback before sending a new operation.&lt;/p&gt;
&lt;p&gt;Nordic provides some Android source code examples on Github, &lt;a href="https://github.com/NordicSemiconductor/Android-nRF-Toolbox/blob/b4fdad1ebc5517e6fadc7181caa6a301815e9f48/app/src/main/java/no/nordicsemi/android/nrftoolbox/profile/BleManager.java#L713"&gt;have a look here for instance&lt;/a&gt;. You can see an example with a queue of operations.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android - Never get notification</title><link>https://devzone.nordicsemi.com/thread/55701?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2016 09:42:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a8f1448-4f6e-4724-8e26-929fabec991b</guid><dc:creator>Troud</dc:creator><description>&lt;p&gt;Yes i&amp;#39;ve done that. I also try with the flag indication, but nothing...
I&amp;#39;ve resolve the problem by threading the write.
Each writing operation is made by a new thread, and with that solution i get notification.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android - Never get notification</title><link>https://devzone.nordicsemi.com/thread/55702?ContentTypeID=1</link><pubDate>Sun, 19 Jun 2016 22:39:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7ee583a-6113-40c6-aa9e-29d81744d739</guid><dc:creator>Vyacheslav Lebets</dc:creator><description>&lt;p&gt;Hi. First, You should enable notification sending 1 to cccd descriptor of desired characteristic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>