I am currently trying to scan BLE devices, I am using a Galaxy S9+ with android 9.0. It seems unfiltered scans don't work with galaxy s9+ so I added filters like this
String serviceUuidString = "51525354-5556-5758-5950-abbccddeeff0"; //uuid i wanna scan String serviceUuidMaskString = "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF"; ParcelUuid parcelUuid = ParcelUuid.fromString(serviceUuidString); ParcelUuid parcelUuidMask = ParcelUuid.fromString(serviceUuidMaskString); ScanFilter filter1 = new ScanFilter.Builder().setServiceUuid(parcelUuid, parcelUuidMask).build(); filters.add(filter1);
This did not work but as soon as I added this
ScanFilter filter = new ScanFilter.Builder().setDeviceAddress("D8:09:1A:58:41:39").build(); filters.add(filter);
It started detecting beacons after phone is locked. I dont think aadding each and every mac would be a good method though. Is there something wrong being done while adding filters for uuid?
this is how i build settings
settings = scanSettingsBuilder.build();