<?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>start stop scanning in android app</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/4350/start-stop-scanning-in-android-app</link><description>Hi 
 How to start and stop scanning continuously in android devices ?.I found that In Nrf master control panel android app there is an option of performing scanning such that it can display the dynamic data that nrf51822 is advertising (settings-&amp;gt;scanner</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Nov 2014 09:48:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/4350/start-stop-scanning-in-android-app" /><item><title>RE: start stop scanning in android app</title><link>https://devzone.nordicsemi.com/thread/15481?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2014 09:48:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42cd0707-112b-4ea5-bd4d-1a29be67a9cd</guid><dc:creator>hrg</dc:creator><description>&lt;p&gt;HI Hung , when i use nexus 5 i no need to do start stop scanning so i used  the old scanning method ,it was able to scan the new data but it couldnt update in listview.  How to update the listview whever i get new data ??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: start stop scanning in android app</title><link>https://devzone.nordicsemi.com/thread/15480?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2014 09:11:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f0a9611-7617-4a58-a75d-d44095a75d14</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi hrg,&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t seen your code to re-start the scanning after one second. What I find in the code is you stop scanning after a SCAN_PERIOD.
In addition, you would need to make sure you update the list view every time you have new data, and also every time you stop scanning.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: start stop scanning in android app</title><link>https://devzone.nordicsemi.com/thread/15479?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2014 05:12:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0dc611d1-569c-447d-9fd1-5de623718b0b</guid><dc:creator>hrg</dc:creator><description>&lt;p&gt;Mr Hung ,Yea You are right am using nexus 7 !  and now i tried with nexus 5 its working well :)  !! but here is the problem -- i can see that app is scanning for new data packets ,but its not displaying or refresing the data in the app display ! i have posted the code above for scanning. So where i have to clear the devicelist and update with new values ?
Thankyou&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: start stop scanning in android app</title><link>https://devzone.nordicsemi.com/thread/15476?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 12:44:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:530c9a87-909d-4527-a2ae-7bc89ef2ff5d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Hrg,&lt;/p&gt;
&lt;p&gt;I am now reminded that we had the issue with Nexus 4 and Nexus 7 that it only notify with LEScancallback() only once per scan. I guess you has one of this phone ?&lt;/p&gt;
&lt;p&gt;You are correct that we (in the MCP) stop and start scanning every one second. I was wrong about this.&lt;/p&gt;
&lt;p&gt;But it&amp;#39;s pretty strange what you reported that if you do it automatically using a timer, it won&amp;#39;t work, but if you do it manually it worked.
Could you please update the code snippet where you do that scanning? Please add that code  in the question you post above.&lt;/p&gt;
&lt;p&gt;I will try to get the developer who made the nRF MCP to help you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: start stop scanning in android app</title><link>https://devzone.nordicsemi.com/thread/15475?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 12:37:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c304f38-a6f1-4c5b-a088-25ef9844f7a3</guid><dc:creator>hrg</dc:creator><description>&lt;p&gt;while the ble is broadcasting (eg incremented data like 1,2,3 etc) ,once scan button is pressed it displays once ,again to refresh the display i need to stop it and again press scan button .Yea i used the runnable  delay to stop it for one second and called again ,but it dint work .
It would be great if you provide the codebase of it !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: start stop scanning in android app</title><link>https://devzone.nordicsemi.com/thread/15474?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 12:29:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f04ad58-d227-4057-a898-e30e13124650</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi hrg,&lt;/p&gt;
&lt;p&gt;LEScancallback() is called on every single advertising packet received when you are scanning. It&amp;#39;s not called once on very startLeScan() you call.
What you see in nRFMCP app that the data is updated every one second is that we use a 1 second timer to update the List on the screen, instead of update continuously whenever we receive a advertising packet.&lt;/p&gt;
&lt;p&gt;Could you explain a little bit more on &amp;quot;When i use the start and stop scan again and again it is neglecting the startscan calls ! so i couldnt refresh the new broadcasted data ,i have to manually stop scanning and then start it again which is a tiresome task &amp;quot;
What is the difference between &amp;quot;start and stop scan again and again&amp;quot; and &amp;quot;manually stop scanning and then start it again&amp;quot; ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: start stop scanning in android app</title><link>https://devzone.nordicsemi.com/thread/15478?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 12:18:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89d22106-457c-4a87-b25f-b065cfeff0d6</guid><dc:creator>hrg</dc:creator><description>&lt;p&gt;Actually my intention is to start scan stop it then again startscan  ,stop it -to perform this continuously so that the LEScancallback is called everytimme and it displays the immediate broadcasted data in the app !
When i use the start and stop scan again and again it is neglecting the startscan calls ! so i couldnt refresh the new broadcasted data ,i have to manually stop scanning and then start it again which is a tiresome task .  But in NRF master control panel , i have seen that it automatically starts and stops it for one second and again it starts ,stops continuously.I need to perform the same task in my app. So could you please explain the scanningactivity.java of nrfmastercontrol panel !
Thankyou&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: start stop scanning in android app</title><link>https://devzone.nordicsemi.com/thread/15477?ContentTypeID=1</link><pubDate>Mon, 10 Nov 2014 16:40:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:517459ef-c5be-4483-bbec-892ae7f053e1</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi hrg,&lt;/p&gt;
&lt;p&gt;As mentioned, that option is only to remove the timer to stop scanning. If you remove that timer, you will scan forever.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: start stop scanning in android app</title><link>https://devzone.nordicsemi.com/thread/15473?ContentTypeID=1</link><pubDate>Fri, 07 Nov 2014 11:50:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f1500d4-cae6-46d4-99c8-8f8721651170</guid><dc:creator>hrg</dc:creator><description>&lt;p&gt;Thankyou Hung Bui !. My intention is i need to start scan for a second ,then stop &amp;amp; do this  continuously ,so that LeScan callback is called everytime and then it updates with new broadcasting value.I have seen such an optin in nrfmaster control panel , but not in nrftoolbox . so it would be great if you provide the scanner.java file of nrfMastercontrol panel .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: start stop scanning in android app</title><link>https://devzone.nordicsemi.com/thread/15472?ContentTypeID=1</link><pubDate>Fri, 07 Nov 2014 09:36:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76298872-cd38-4dc0-9ba9-fdfd783bd167</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Hrg,&lt;/p&gt;
&lt;p&gt;Actually you can find the code that we limit the period of scanning in nRFToolbox at function  startScan() in ScannerFragment.java file.&lt;/p&gt;
&lt;p&gt;We used a timer and defined a period SCAN_DURATION to stop scanning.&lt;/p&gt;
&lt;p&gt;The reason we do this is to avoid continuous scanning (that can draw lots of power of the phone) when the app is in background or when the customer forgot to stop scanning.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: start stop scanning in android app</title><link>https://devzone.nordicsemi.com/thread/15471?ContentTypeID=1</link><pubDate>Fri, 07 Nov 2014 05:36:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab82c849-b33e-4837-abbb-a7429453373d</guid><dc:creator>hrg</dc:creator><description>&lt;p&gt;Could anybody give a response ! Thankyou&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>