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.

Misuse of mBluetoothAdapter.isMultipleAdvertisementSupported()

See original GitHub issue

In https://github.com/WebBluetoothCG/ble-test-peripheral-android/blob/master/app/src/main/java/io/github/webbluetoothcg/bletestperipheral/Peripheral.java there is:

if (!mBluetoothAdapter.isMultipleAdvertisementSupported()) {
  Toast.makeText(this, R.string.bluetoothAdvertisingNotSupported, Toast.LENGTH_LONG).show();
  Log.e(TAG, "Advertising not supported");
}

And this is misuse of isMultipleAdvertisementSupported, check this https://github.com/AltBeacon/android-beacon-library/issues/266:

It is important to understand that just because isMultipleAdvertisementSupported() returns false does not mean that the device cannot advertise at all – it means either that it cannot advertise at all OR that it can only transmit one advertisement at a time. Many Motorola devices (Moto X, Moto G) behave this way. The way you are supposed to check if advertising is supported at all is to get an instance of BluetoothLEAdvertiser. If the call to get an instance fails, then it is not supported.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
nowavewatercommented, Jul 3, 2018

Actually, it’s not required to support multiple advertisement for Android device to act as peripheral role. Check the official example.

I have a device which returns false with isMultipleAdvertisementSupported(), it works just with the official example.

1reaction
abdoutech93commented, Apr 6, 2020

Actually, it’s not required to support multiple advertisement for Android device to act as peripheral role. Check the official example.

I have a device which returns false with isMultipleAdvertisementSupported(), it works just with the official example.

THANKS A LOT, you made my day

Read more comments on GitHub >

github_iconTop Results From Across the Web

Locate Beacon app returns different from ... - GitHub
It is important to understand that just because isMultipleAdvertisementSupported() returns false does not mean that the device cannot advertise ...
Read more >
Why isMultipleAdvertisementSupported() returns false, when ...
These devices return a BluetoothLeAdvertiser despite the fact that isMultipleAdvertisementSupported() returns false. A Motorola engineer explained to me ...
Read more >
BluetoothAdapter - Android Developers
To get a BluetoothAdapter representing the local Bluetooth adapter, ... Use isMultipleAdvertisementSupported() to check whether LE Advertising is supported ...
Read more >
Diff - 56d16568c0233dacec8f3c20cc987b2b68298e7a^2 ...
Closeable { method public void close() throws java.io.IOException; method public void ... diff --git a/core/java/android/bluetooth/BluetoothAdapter.java ...
Read more >
Working Smarter - Advertising - Google Sites
private BluetoothAdapter mBluetoothAdapter = ((BluetoothManager) ... onStartFailure() method of an AdvertiseCallback implementation.
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