<?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>How to Find Nordic Beacon Using BLE onLeScan() for Android</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9775/how-to-find-nordic-beacon-using-ble-onlescan-for-android</link><description>I&amp;#39;m an Android developer and I bought the NRF51822-Beacon kit. All I want to do is be able to &amp;quot;see&amp;quot; the beacon using Android&amp;#39;s onLeScan() bluetooth call. However, the beacon doesn&amp;#39;t register at all. I can see other BLE devices, but not the Nordic beacon</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 Oct 2015 10:31:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9775/how-to-find-nordic-beacon-using-ble-onlescan-for-android" /><item><title>RE: How to Find Nordic Beacon Using BLE onLeScan() for Android</title><link>https://devzone.nordicsemi.com/thread/36194?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2015 10:31:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb3498a6-c633-4606-911f-366980fe7f6b</guid><dc:creator>RaQ</dc:creator><description>&lt;p&gt;Yes, it is very odd. I ran it in purple (normal beaconing), yellow (config) Sw2, and even blue (Sw1) mode. Nothing. My app is designed to show information (even if very brief) anytime it grabs a signal. I left it running for almost an hour and it never picked up the beacon. I turned on another BLE that I know only beacons once every 1-2 seconds, and my app saw it just fine. It never once saw the Nordic beacon. I will try changing the advertising rate later, though at the default 760ms, it&amp;#39;s still faster than the other beacon that definitely works, and should have been seen without fault at least once.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Find Nordic Beacon Using BLE onLeScan() for Android</title><link>https://devzone.nordicsemi.com/thread/36193?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2015 10:23:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b8b0c31-de67-4dec-a882-ba94344b6db1</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Your code is very good should work. So I guess the problem is with a beacon. Give your app some more time to find it. By default the nordic beacon advertises every 760ms which is quite rare. This makes it hard to be found. You may also press the SW2 button on the beacon (this will start the Config Mode with different adv interval) or SW1 - enables the DFU mode. In the DFU mode the beacon advertises very often so your app should easily find it.&lt;/p&gt;
&lt;p&gt;You may also change the setting of the beacon and make it advertise more often. Press the SW2 button (it it&amp;#39;s in DFU mode you need to take the battery out and in again and press SW2), connect to it using nRF Beacon app (the UPDATE tab) and change the advertising interval to 100ms. I would also recommend to disable the LED as it drains the most of the battery. After that you can check if your app can find it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Find Nordic Beacon Using BLE onLeScan() for Android</title><link>https://devzone.nordicsemi.com/thread/36192?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2015 09:57:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e11bca4-79ab-4be9-808e-73779ff57495</guid><dc:creator>RaQ</dc:creator><description>&lt;p&gt;Here is the whole code. It should show the device name, rssi, and bluetooth address. Even if the name is null, the latter two elements should still show. I don&amp;#39;t have access to Lollipop, only KitKat. Yes, my app finds other BLE devices but not my beacon.&lt;/p&gt;
&lt;p&gt;public class MainActivity extends Activity {&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// VARIABLES - FOR FINDING BLE DEVICE

BluetoothAdapter btAdapter;
final int REQUEST_ENABLE_BT = 1;	// A value &amp;gt; 0 which ensures the corresponding activity is
                                    // launched as a sub-activity

Button btn_name, btn_address, btn_rssi;


/* TURNS ON BLUETOOTH */
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // GENERAL SETUP

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    setContentView(R.layout.activity_main);

    Log.e(&amp;quot;Main: onCreate()&amp;quot;, &amp;quot;Starting&amp;quot;);

    // GET STATUS

    btn_name = (Button) findViewById(R.id.name);
    btn_address = (Button) findViewById(R.id.address);
    btn_rssi = (Button) findViewById(R.id.rssi);

    // GET BLUETOOTH ADAPTER --- NECESSARY FOR DEVICE DISCOVERY
    //
    // Also check that the Android device has Bluetooth enabled. Will request the user enable
    // Bluetooth if it is currently disabled

    final BluetoothManager btManager = (BluetoothManager)getSystemService(Context.BLUETOOTH_SERVICE);
    btAdapter = btManager.getAdapter();	// The phone&amp;#39;s Bluetooth radio

    if (btAdapter != null &amp;amp;&amp;amp; !btAdapter.isEnabled()) {
        Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
        enableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION,0);
        startActivityForResult(enableIntent, REQUEST_ENABLE_BT);	// Enables Bluetooth if disabled
    }
    else
        btAdapter.startLeScan(mLeScanCallback);
}


/* QUIT IF THEY DIDN&amp;#39;T ENABLE BLUETOOTH */

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // User didn&amp;#39;t enable Bluetooth
    if ((requestCode == REQUEST_ENABLE_BT) &amp;amp;&amp;amp; (resultCode == Activity.RESULT_CANCELED)) {
        finish();
        return;
    }
    super.onActivityResult(requestCode, resultCode, data);

    btAdapter.startLeScan(mLeScanCallback);
}


/* DEVICE DISCOVERY */

private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback() {

    @Override
    public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) {
        runOnUiThread(new Runnable() {

            @Override
            public void run() {

                Log.e(&amp;quot;Main: LeScanCallback()&amp;quot;, &amp;quot;rssi &amp;quot; + rssi + &amp;quot; device &amp;quot; + device.getName() +
                        &amp;quot;  &amp;quot; + device.getAddress());

                btn_name.setText(device.getName());
                btn_address.setText(device.getAddress());
                btn_rssi.setText(&amp;quot;&amp;quot;+rssi);
            }
        });
    }
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Find Nordic Beacon Using BLE onLeScan() for Android</title><link>https://devzone.nordicsemi.com/thread/36191?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2015 09:39:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b550837-e260-45de-9e6a-ee980e56e257</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Thanks. This code is OK and should work.
The scanner-compat library does not limit you to any nordic devices. It just wraps the standard API with some other classes and gives you parsing, batch scanning etc. Those features were added in Android Lollipop or later. Does your app find other BLE devices but does not find your beacon? Remember, that the beacons name is null. Could you also post the code how do you start scanning?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Find Nordic Beacon Using BLE onLeScan() for Android</title><link>https://devzone.nordicsemi.com/thread/36190?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2015 09:33:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0139a809-143a-49c2-8ee7-f985170ed899</guid><dc:creator>RaQ</dc:creator><description>&lt;p&gt;/* DEVICE DISCOVERY */&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback() {

    @Override
    public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) {
        runOnUiThread(new Runnable() {

            @Override
            public void run() {

                Log.e(&amp;quot;Main: LeScanCallback()&amp;quot;, &amp;quot;rssi &amp;quot; + rssi + &amp;quot; device &amp;quot; + device.getName() +
                        &amp;quot;  &amp;quot; + device.getAddress());

                btn_name.setText(device.getName());
                btn_address.setText(device.getAddress());
                btn_rssi.setText(&amp;quot;&amp;quot;+rssi);
            }
        });
    }
};
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Find Nordic Beacon Using BLE onLeScan() for Android</title><link>https://devzone.nordicsemi.com/thread/36189?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2015 09:33:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5be249e0-a1f8-46af-b32d-790726148c8b</guid><dc:creator>RaQ</dc:creator><description>&lt;p&gt;Here is the code. It is designed to recognize any BLE device within signal range. I&amp;#39;ve tested it on many devices. I can&amp;#39;t understand why it isn&amp;#39;t seeing the Nordic beacon. I&amp;#39;m trying to avoid using Nordic-specific code so I&amp;#39;m not limited to just working with Nordic beacons.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Find Nordic Beacon Using BLE onLeScan() for Android</title><link>https://devzone.nordicsemi.com/thread/36188?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2015 09:26:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:149407ff-7829-4abc-baf4-4bac8e98e8c5</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hi RaQ,&lt;/p&gt;
&lt;p&gt;The startLeScan() method from BluetoothAdapter should work for any BLE device, including nordic beacons. If you see the beacon in nRF Beacon app, nRF Master Control Panel or any other app that scans for Bluetooth Smart devices - they use the same API. I would also recommend you to use our compat library for scanning: &lt;a href="https://github.com/NordicSemiconductor/Android-Scanner-Compat-Library"&gt;github.com/.../Android-Scanner-Compat-Library&lt;/a&gt;. With t you&amp;#39;ll have some more settings and filtering options. The scanning API on Android has changed in 5.0 and this library gives the new functionality to older platforms. but even if you use the bluetoothAdapter.startLeScan(callback) method it should work. Make sure you update your GUI in the UI thread, not in the callback thread.&lt;/p&gt;
&lt;p&gt;Could you post you code here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Find Nordic Beacon Using BLE onLeScan() for Android</title><link>https://devzone.nordicsemi.com/thread/36187?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2015 08:59:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63363781-0668-4a16-996e-7365ae5038ab</guid><dc:creator>RaQ</dc:creator><description>&lt;p&gt;Yes, I can see the beacon using the Nordic app. I can see other BLE devices using onLeScan(), but not this one. I&amp;#39;m using Android KitKat 4.3. Do I need to install certain firmware or software on the beacon first in order to see it? I would not have thought so, but I haven&amp;#39;t really worked with hardware itself before, so I&amp;#39;m not sure.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Find Nordic Beacon Using BLE onLeScan() for Android</title><link>https://devzone.nordicsemi.com/thread/36186?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2015 08:43:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64c92122-3fd3-4b54-8e5c-0ce05ce97f76</guid><dc:creator>Artucas</dc:creator><description>&lt;p&gt;I also bought two NRF51822-Beacon kit&amp;#39;s recently and i had no problems detecting them with my own android app. Are you able to find other devices using onLeScan() method? What is your Android version?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Find Nordic Beacon Using BLE onLeScan() for Android</title><link>https://devzone.nordicsemi.com/thread/36185?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2015 08:41:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c70643c-0b77-444b-8257-d894b6b48336</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Are you able to see the beacon using the Nordic app?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>