<?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 dropping BLE advertising packets</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35840/android-dropping-ble-advertising-packets</link><description>Hi there, 
 I&amp;#39;m new to Android BLE development and simply trying to read out a BLE temperature sensor that encodes the temp. in the service data from the advertising packets. This works, however the update rate is very slow (~1min), while the two sensors</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Jun 2018 12:58:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35840/android-dropping-ble-advertising-packets" /><item><title>RE: Android dropping BLE advertising packets</title><link>https://devzone.nordicsemi.com/thread/137905?ContentTypeID=1</link><pubDate>Wed, 27 Jun 2018 12:58:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c54e506-fbf2-4239-8dd9-9b436e72dff3</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Here are my advices:&lt;br /&gt;&lt;br /&gt;(Related to your problem)&lt;br /&gt;1. Why do you start scanning in AsyncTask? You should avoid AsyncTasks in Activities as they may leak the Context. Just start scanning in the startScanning() method. The same with stopping scanning.&lt;br /&gt;2. How about setting just the SCAN_MODE_LOW_LATENCY and remove the 3 other settings. Use default values.&lt;br /&gt;3. Try scanning without filter and discard non-matching records. Just check if you get updates more often.&lt;br /&gt;(General)&lt;br /&gt;4. You startScanning() also if the Bluetooth is disabled or absent, or you don&amp;#39;t have permission.&lt;br /&gt;5. After the permission has been granted you don&amp;#39;t start scan.&lt;br /&gt;6. Keep the ParcelUuid as a constant, don&amp;#39;t create a new instance each time you find a device.&lt;br /&gt;7. Use ScrollView with TextView inside instead of scrolling TextView.&lt;br /&gt;8. We recommend to use &lt;a href="https://github.com/NordicSemiconductor/Android-Scanner-Compat-Library"&gt;Android Scanner Compat Library&lt;/a&gt;. This brings same scanning API to older platforms.&lt;br /&gt;9. Use DialogFragment instead with AlertDialog, instead of just AlertDialog. Then it will not be dismissed on rotation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>