question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to scan for other Android phones

See original GitHub issue

I’ve successfully used this library for scanning some hardware devices (BT chips ESP32, Sierra Wireless, etc.). But, I’m unable to detect other Android phones (that have Bluetooth and Location enabled).

Is there any specific configuration necessary to be added, or this is not possible to be achieved?

This is my implementation:

public synchronized void startScan() {
		final ScanSettings settings = new ScanSettings.Builder().setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
			.setReportDelay(1000)
			.setUseHardwareBatchingIfSupported(false)
			.build();
		
		BluetoothLeScannerCompat scanner = BluetoothLeScannerCompat.getScanner();
		try {
			scanner.startScan(null, settings, scanCallback);
			Log.d(LOG_TAG, "BLE start scan.");
		} catch (IllegalArgumentException e) {
			Log.d(LOG_TAG, e.getMessage());
		}
	}

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
philips77commented, May 6, 2020

On the other hand, iOS devices do advertise without any app, as they use it for AirDrop. Apps can customize and add their data to the packet, but even without them the phone will advertise. Same with Macs with support for BLE.

1reaction
philips77commented, May 6, 2020

Yes, you need to advertise in an app. We recommend nRF Connect for Android, available on Google Play, where you can customize the advertising packet in UI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Not Scanning a QR Code: 7 Ways to Troubleshoot
7 ways to troubleshoot if your Android device is not scanning a QR code · Center the QR code on the screen ·...
Read more >
Unable to scan for networks (wifi problem)
Go to wireless networks> mobile network options> uncheck always enable mobile network. When you go back a step to wireless networks, have both ......
Read more >
6 Best Ways to Fix QR Code Scanner Not Working on Android
Step 1: Open the Camera app on your Android phone. Step 2: Tap the downward arrow icon at the top. Step 3: Tap...
Read more >
Unable to Scan for Networks - Samsung Moment
Whenever I turn on WiFi, it says "Scanning", then "Unable to Scan for Networks" window pops up. Sometimes it scans just once, other...
Read more >
Find & set up devices near you - Android Help
Open your phone's Settings app. Tap Google and then Devices & sharing and then Devices. Turn Scan for nearby devices on or off....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found