androidkotlinbeaconeddystone

Detect beacon without hard coding UUID in Android app


I want my app to display a notification when it is in the vicinity of a beacon. But I don't wanna hard code the UUID of the beacon in my program. How can I achieve this?


Solution

  • Two options:

    1. Simply omit the ProximityUUID in the Region definition when scanning for beacons and the AndroidBeaconLibrary will detect all beacons regardless of UUID.

    2. include the ProximityUUID in the Region definition, but fetch the value from a web service call you make first. This way, you can change the UUID on your server whenever you want without having to update your app's hard-coded value.