<?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>Service discovery function takes a long time on Android</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64440/service-discovery-function-takes-a-long-time-on-android</link><description>Hello, Nordic. 
 
 I am developing a project that is based on interactive services that exchange data through BLE connections. 
 Everything is good except for service discovery on Android. 
 
 
 I&amp;#39;ve tried a number of different methods, but I found that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 Aug 2020 12:06:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64440/service-discovery-function-takes-a-long-time-on-android" /><item><title>RE: Service discovery function takes a long time on Android</title><link>https://devzone.nordicsemi.com/thread/263598?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2020 12:06:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cb3b1ed-b3a6-4baa-9bfb-4286fbcaa7a7</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I am not sure. I believe you should check with an Android forum. We deliver some test applications, such as nRF Toolbox. These use the Android libraries, and that is not something that we have made, so I am not sure how that works.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Service discovery function takes a long time on Android</title><link>https://devzone.nordicsemi.com/thread/263373?ContentTypeID=1</link><pubDate>Thu, 06 Aug 2020 08:49:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6622256f-5984-41f6-92f5-4bb1cf7458d0</guid><dc:creator>leejh</dc:creator><description>&lt;p&gt;We have done a lot of tests, and Android takes 0.5 seconds on average, and there are very few within 0.4 seconds. The iPhone has 0.3 seconds, and after finding first service discovering, it caches the GATT and does not request a service from the next.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So, We concluded that caching GATT on Android is the answer, and we didn&amp;#39;t find a way to do it in the Android Bluetooth standard library, so we wrote this post. Back to the question, do you know how to cache the GATT in the Android Bluetooth Library??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Service discovery function takes a long time on Android</title><link>https://devzone.nordicsemi.com/thread/263137?ContentTypeID=1</link><pubDate>Wed, 05 Aug 2020 08:30:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3661ba8b-fe2b-4c45-ae3d-f901e41166e8</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;If it takes 0.5 seconds, why does it take that long compared to iOS? Does iOS complete faster? from the sniffer trace, why does it take longer? Is the Android using longer time to call the service discovery? Is it possible to send the sniffer trace? If possible one that is slow and one that is fast (as expected).&lt;/p&gt;
&lt;p&gt;It doesn&amp;#39;t sound like there is much we can do. The nRF should reply to the service discovery as soon as it is received. Perhaps you can try with a different android phone and see if the behavior is the same, or if you can find some way in the android application to speed it up. But if it also happens in nRF Connect for Android, then it sounds like the delay is caused by the Bluetooth chip/driver on the phone.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Service discovery function takes a long time on Android</title><link>https://devzone.nordicsemi.com/thread/263122?ContentTypeID=1</link><pubDate>Wed, 05 Aug 2020 07:56:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2880c30f-53e8-48fc-a647-3e0500c3cb23</guid><dc:creator>leejh</dc:creator><description>&lt;p&gt;Hi, Edvin.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I tested SDK 15.3.0, the result is equally slow. Also, as a result of checking the packets through nRF Sniffer, it was also checked that it took a long time in service request and service response (about 0.5 sec)&lt;/p&gt;
&lt;p&gt;The slow operation through nRF Connect was equally slow, but I couldn&amp;#39;t debug it, so I couldn&amp;#39;t check the exact time.&lt;/p&gt;
&lt;p&gt;I tried various connection intervals and found that it was not a connection speed problem, but a service discovery problem.&lt;/p&gt;
&lt;p&gt;The reason for using SDK9 is that we have been working on many projects have been done with the SDK9 and there is no difference from SDK12 in the part we need.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Service discovery function takes a long time on Android</title><link>https://devzone.nordicsemi.com/thread/262959?ContentTypeID=1</link><pubDate>Tue, 04 Aug 2020 10:46:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1543b421-6718-41cf-9990-9ab052081c7b</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Have you tried to use any of the default examples from a later SDK? Is the service discovery equally slow? Or did you try to connect to the device using nRF Connect for Android? Is the service discovery still slow?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Have you tried sniffing the connection? You can use nRF Sniffer for that. It may reveal possible resons why it takes long time. Perhaps the connection interval is too&amp;nbsp; high, so that sending the service discovery packets and receiving the response takes a long time.&lt;/p&gt;
&lt;p&gt;I want to ask what your connection interval is, but since this is always decided by the central, it may not be that easy to say without a sniffer trace (nRF Connect).&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;And while we&amp;#39;re at it. Any particular reason why you are using SDK9? I would recommend using SDK12.3.0, which is the latest SDK version that supports nRF51.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>