2
votes

I've implemented the bluetooth le sample the Android provide for connecting a to heart rate monitor but now I'm wishing to simply detect other devices that have bluetooth le on.

Has anyone made the modification I want to do on that sample? Or does anyone know if there is a Gatt Attribute page or something I could use to do it myself?

1
As far as I can remember, the BLE sample from API 18, scans for all nearby BLE devices. IS that what you want? Could you be more precise? - edoardotognoni
Yes, I simply want to locate any BLE device that I have around me. However, that sample if what I'm using and it seems to only want to find heart rate measurements. - N0xus
Are you using this method? mBluetoothAdapter.startLeScan(mLeScanCallback); - edoardotognoni
I am use the sample project that Android provide above. So yes. - N0xus
So this method is not filtering for any BLE profile. So in the list you will see any BLE device around you - edoardotognoni

1 Answers

1
votes

The sample Android project does this by default. I installed it on my Android device and pressing "Scan" made surrounding BLE Device pop up. I'm not sure if you're using the right sample, but you can import it through the sample projects thingy in Android Studio.

There is some heartrate-specific code in that sample project, but that regards to specifically handling heart rate measurement data and is meant to show how to read specific services.

I was able to succesfully read a blood pressure measurement looking at the heart rate examples in the code and adapting it to my needs.