Is there any way to advertise raw data over BLE in Android?

113 Views Asked by At

i am currently working on an App that transmits Bluetooth LE Advertisers. I am currently using the "default" way, create AdvertiseSettings and AdvertiseData using the Android API for that. But i would like to know if there is any known way to send a complete custom Package (Byte Array) as Advertiser.

Thx anyway :)

1

There are 1 best solutions below

0
On BEST ANSWER

Unfortunately there isn't. This default way of using AdvertiseData is the only way to set BLE adverts on Android. However this was done on purpose to ensure compliance with the Bluetooth specification, as otherwise you would be able to send any sort of adverts that don't follow the required guidelines.

If your goal is to send a custom byte array via the adverts you can always do this through the addManfacturerData method. This is usually used to add information related to the manufacturer but you can use it to add an array of custom length (as long as it is shoter than the max advert length), and then scan for this field from a remote app in order to read the data.