<?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-BLE-Library using LiveData with several services on the same peripheral</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65589/android-ble-library-using-livedata-with-several-services-on-the-same-peripheral</link><description>Hello, 
 I am currently developing an Android library to connect a smartphone with a peripheral device that serves several bluetooth services. BAS, DIS and 2 other private services. 
 For this development, I use the Android-BLE-Library 2.2.4 from Nordic</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Sep 2020 09:35:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65589/android-ble-library-using-livedata-with-several-services-on-the-same-peripheral" /><item><title>RE: Android-BLE-Library using LiveData with several services on the same peripheral</title><link>https://devzone.nordicsemi.com/thread/268463?ContentTypeID=1</link><pubDate>Tue, 08 Sep 2020 09:35:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2145af3-8a91-4117-827e-46cfee51d8a9</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;When a device connects, you will get isRequiredServiceSupported method call, where you&amp;#39;ll get the BluetoothGatt object. In that method you should get references to all characteristics and descriptors that you need, from all your services. Your may organize them whatever you like and expose any API from the Ble Manager as you want, e.g. create method that will return LiveData objects with parsed characteristic values, organize them in services/plugins/modules, etc. How the manager is visible from outside is up to you, but internally it should have references to Gatt attributes so it can send and receive data.&lt;/p&gt;
&lt;p&gt;You may also take a look at nRF Toolbox, where battery level is handled in a base class, from which (almost) all other managers derive. That is another way of doing it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>