<?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: Read characteristic without service discovery</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16658/android-read-characteristic-without-service-discovery</link><description>We are writing an Android app for our own peripheral (nRF51-based). We know the handles for all the characteristics. 
 On Android gatt.discoverServices() needs to be called, and wait for onServicesDiscovered(), then getServices(), before the Characteristic</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 27 Sep 2016 09:33:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16658/android-read-characteristic-without-service-discovery" /><item><title>RE: Android: Read characteristic without service discovery</title><link>https://devzone.nordicsemi.com/thread/63735?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2016 09:33:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77c00ac4-0e0a-4dd8-8d45-39cf2e8e501a</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;To avoid this problem:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;make sure the nRF Connect is closed with Back button&lt;/li&gt;
&lt;li&gt;disable GATT Server, or switch the option mentioned above to OFF&lt;/li&gt;
&lt;li&gt;wait for ~2 sec before calling discoverServices(). In this time nRF should be ready and you should get services from cache immediately.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android: Read characteristic without service discovery</title><link>https://devzone.nordicsemi.com/thread/63734?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2016 09:31:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ddc1606-8bc5-4f12-bfa2-d9c1d353e544</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hi, all the BLE-related method calls are listed on the Log in nRF Connect on DEBUG level. Also, I write there delays (e.g wait(600)).
nRF Connect waits for 600ms after it gets connected before calling discoverServices().
Also, (IMPORTANT) if you have nRF Connect in the background (left with HOME button, or switched to another app without exiting the nRF app with a Back button), and there was the GATT server enabled (any configuration,even empty has been selected), and Settings-&amp;gt;Connectivity-&amp;gt;Show incoming connection is enabled (default), the nRF Connect (or any other app with GATT Server running) will &amp;quot;intercept&amp;quot; your connection on Android pre-7.0. It has been fixed in 7.0. Before, the connection could had only 1 listener for service discovery, so if you call serviceDiscovery(), then nRF calls it again, only nRF gets callback.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android: Read characteristic without service discovery</title><link>https://devzone.nordicsemi.com/thread/63733?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2016 11:50:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12dd1310-913c-4b76-8438-55a429d65d72</guid><dc:creator>PVS</dc:creator><description>&lt;p&gt;That is a very good question. I can always get the services using the nRF MCP app. In fact, after initiating connection from my app, when it gets GATT_CONNECTED, and I then switch over to MCP, it shows the peripheral as connected as well, and I can even do discover services from MCP, successfully. The Android recommended procedure is so simple (call discoverServices upon getting newState == GATT_CONNECTED in onConnectionStateChange), I don&amp;#39;t even have any other options to try.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android: Read characteristic without service discovery</title><link>https://devzone.nordicsemi.com/thread/63732?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2016 11:41:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:113d436b-8e4b-4fe5-80b1-71d2be12664a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;No, as far as I know.&lt;/p&gt;
&lt;p&gt;How often do you have the issue &amp;quot;often onServicesDiscovered() does not get called&amp;quot; ? Do you see that when you use our nRFConnect app ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>