I need my app to get notified when it is in range of a specific BLE device. Once in range, I want to connect to the device and send data to it.
Approach 1:
Periodic BLE scans at some interval (i.e. every 30 seconds). However, this would not be good for battery. I can improve this a bit by only scanning when the device location is near the location of the BLE device (via Android Geofence APIs). But still, not great for battery.
Approach 2:
Use Android Awareness API. This seems like a great candidate. However, it seems you are forced to register your BLE device with Google as a BLE beacon. Does anyone know if this is an absolute requirement? I do not want to register it with Google.
Have a look into the Android Altbeacon library. It can do what you need with battery saving features.
Regarding approach 1, sample code from the library below.