<?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]how to disconnect connection gracefully</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24404/android-how-to-disconnect-connection-gracefully</link><description>hi, Nordic
I&amp;#39;m using your nRF51-DK(PCA10028) board, on android, i disconnect connection by call BluetoothGatt.disconnect ( developer.android.com/.../BluetoothGatt.html , it&amp;#39;s work fine on almost android phones, but on some ones (such as xiaomi4LTE )</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 18 Aug 2017 09:28:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24404/android-how-to-disconnect-connection-gracefully" /><item><title>RE: [android]how to disconnect connection gracefully</title><link>https://devzone.nordicsemi.com/thread/96130?ContentTypeID=1</link><pubDate>Fri, 18 Aug 2017 09:28:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d10f69f7-ddda-41d0-9034-064a8e5238eb</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Also, Spotify app was reported to capture connections and even reconnect to devices. Don&amp;#39;t know if it still does it and if it&amp;#39;s related.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [android]how to disconnect connection gracefully</title><link>https://devzone.nordicsemi.com/thread/96129?ContentTypeID=1</link><pubDate>Fri, 18 Aug 2017 09:25:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5a267ee-eb6b-4299-a95d-08540eea8b5c</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hi, we don&amp;#39;t do any magic in nRF Connect. The same method is used. Make sure you don&amp;#39;t have nRF Connect (or any other app) with GATT server configured and not disabled running in background when you connect/disconnect from your app. Then the nRF Connect could just connect to it as well and your disconnect won&amp;#39;t actually disconnect the physical connection as it is still being used by the nRF app. Just close the nRF Connect with the Back button instead of Home to make sure it&amp;#39;s properly closed.&lt;/p&gt;
&lt;p&gt;When you disconnect, remember to call gatt.close() when you get the onConnectionStateChanged(state: disconnected).&lt;/p&gt;
&lt;p&gt;Also, I highly recommend using the BleManager class from nRF Toolbox. Or at least checking it.
&lt;a href="https://github.com/NordicSemiconductor/Android-nRF-Toolbox/blob/master/app/src/main/java/no/nordicsemi/android/nrftoolbox/profile/BleManager.java"&gt;github.com/.../BleManager.java&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;BR,
Aleksander&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>