<?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>How to receive nRF51 BLE device from android phone notifications?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26632/how-to-receive-nrf51-ble-device-from-android-phone-notifications</link><description>Hi
I&amp;#39;m creating an android app for smartwatch(used nrf51 ble),I have two questions 
 1.I used ANCS(Apple notification center service) in my android app,but nrf51 device didn&amp;#39;t read anything.I added ANCS UUID,characteristics and descriptors,but nrf51</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Nov 2017 13:38:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26632/how-to-receive-nrf51-ble-device-from-android-phone-notifications" /><item><title>RE: How to receive nRF51 BLE device from android phone notifications?</title><link>https://devzone.nordicsemi.com/thread/104775?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2017 13:38:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3f5ebbd-8158-456a-89f4-ebf16546e6bc</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I really don&amp;#39;t understand.&lt;/p&gt;
&lt;p&gt;Could you please describe how do you expect ANCS works, in general?&lt;/p&gt;
&lt;p&gt;And how it doesn&amp;#39;t work as you expected on your implementation ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive nRF51 BLE device from android phone notifications?</title><link>https://devzone.nordicsemi.com/thread/104774?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2017 06:39:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9f89f96-5d03-4766-9a5e-f2528f60c06f</guid><dc:creator>enes.sakut</dc:creator><description>&lt;p&gt;Ok sorry about wrong information I deleted all byte arrays and device send to write request but now I think we have to see Read Request.Am I right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive nRF51 BLE device from android phone notifications?</title><link>https://devzone.nordicsemi.com/thread/104768?ContentTypeID=1</link><pubDate>Fri, 10 Nov 2017 12:06:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e81a4bcc-24f1-4b14-b095-864a17e901ff</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I don&amp;#39;t really understand you. Which write request are you expecting ?  You need to write to the CCCD characteristic to enable notification.&lt;/p&gt;
&lt;p&gt;Which ANCS firmware are you testing ? Please try to test your device with nRFConnect on PC as described in the documentation before you proceed further.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive nRF51 BLE device from android phone notifications?</title><link>https://devzone.nordicsemi.com/thread/104773?ContentTypeID=1</link><pubDate>Thu, 09 Nov 2017 12:03:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ba7998d-9821-4924-a4db-7f5254268e2a</guid><dc:creator>enes.sakut</dc:creator><description>&lt;p&gt;Device doesn&amp;#39;t suppport to UART.I&amp;#39;m sure it has to do a write request,but I don&amp;#39;t know other way?How can I enabled notificaion on the ANCS server on the android phone?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive nRF51 BLE device from android phone notifications?</title><link>https://devzone.nordicsemi.com/thread/104772?ContentTypeID=1</link><pubDate>Thu, 09 Nov 2017 11:34:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e3deaf4-85df-48a0-8244-610dc6bc3315</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I&amp;#39;m not so sure it has to do a write request. As far as I know it just need to enable notification on the ANCS server on the phone. So it can receive notification packet from the phone to the device.
What you need to implement on the Android phone is similar to the test with nRFConnect described &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.1.0/ble_sdk_app_ancs.html?cp=4_0_0_4_2_2_1"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive nRF51 BLE device from android phone notifications?</title><link>https://devzone.nordicsemi.com/thread/104771?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2017 18:31:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76e51053-33c5-41c1-b652-07280254904a</guid><dc:creator>enes.sakut</dc:creator><description>&lt;p&gt;OK I did ANCS way but nrf51 didn&amp;#39;t write or read request on my notification data source.This is my codes&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@Override
    public void onCharacteristicWriteRequest(BluetoothDevice device, int requestId, BluetoothGattCharacteristic characteristic, boolean preparedWrite, boolean responseNeeded, int offset, byte[] value) {
        super.onCharacteristicWriteRequest(device, requestId, characteristic, preparedWrite, responseNeeded, offset, value);
        Log.i(TAG, &amp;quot;onCharacteristicWriteRequest, Device: &amp;quot; + device.getName() + &amp;quot; Characteristic:&amp;quot; + characteristic.getUuid());

        StringBuilder byteArray = new StringBuilder();
        for (byte b: value){
            byteArray.append(String.format(&amp;quot;%20x &amp;quot;, b));
        }
     

        byte[] content = {0x00, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x02, 0x00, 0x4d, 0x00, 0x65, 0x03, 0x00, 0x48, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x6f, 0x00, 0x20, 0x00, 0x68, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x6f, 0x00, 0x20, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x6f};
        mGattServer.sendResponse(device, requestId, 0, 0, content);
        charDataSource.setValue(content);
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I think content is wrong?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive nRF51 BLE device from android phone notifications?</title><link>https://devzone.nordicsemi.com/thread/104770?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2017 16:32:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00029d26-0ef9-4c9b-9848-7e10bc849bcd</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;It means there is no support on the Android phone. You need to write your own code to detect notification, for example a phone call. And then you send the notification (by your app on the phone) to the nRF5 device. As what iOS does for you when you use ANCS. You can either choose to do it exactly the same way as Apple defined with iOS or you can choose to do it your own way of notifying.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive nRF51 BLE device from android phone notifications?</title><link>https://devzone.nordicsemi.com/thread/104769?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2017 10:35:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29216189-59c6-47c8-ac8d-3a1f94d30231</guid><dc:creator>enes.sakut</dc:creator><description>&lt;p&gt;Thank you Hung Bui,&lt;/p&gt;
&lt;p&gt;Yes I know ANCS is for apple.What does it mean manually?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive nRF51 BLE device from android phone notifications?</title><link>https://devzone.nordicsemi.com/thread/104767?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2017 10:18:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b9b766c-5e64-45f4-b20b-4bc42725f1df</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Enes,&lt;/p&gt;
&lt;p&gt;ANCS is for apple. Android doesn&amp;#39;t support it natively. You need to write your code on Android app to send notifications manually. This is the same as defining your own service and characteristic (with ble_app_uart for example).&lt;/p&gt;
&lt;p&gt;Re-using ANCS on Android has the benefit that you don&amp;#39;t need different firmware on the nRF52 size to deal with Android vs iOS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>