It's overdue, but I just published version 2.7 of the Android AltBeacon Library.
You can find it on:
- GitHub
- NuGet
- Xamarin Component Store (update coming soon)
What's new
There have been several major version releases from AltBeacon since the Xamarin library has been updated, so here's a quick rundown of new shiny bits you can expect to find:
Features changes:
- Optionally allow tracking multiple beacons with the same identifiers, distinguishing with the mac address.
- Support for Gatt-based beacons and interleaved frames
- Filter out invalid RSSI values of 127 for distance calculations
- Identifier class now supports conversion to/from the UUID class.
- Optionally allow using an ArmaRssiFilter for faster distance calculation convergence.
- Support detection of Eddystone-UID, Eddystone-TLM and Eddystone-URL
- Support transmission of Eddystone-UID and other GATT-based formats
- Add more options for parsing identifiers of specific lengths
- When scanning in Background on Android 5+, do a full scan without filters during the main scan period (default for 10 seconds once every 5 minutes) in case scan filters are unavailable
- Common open-source BeaconParser layouts are defined as constants on BeaconParser
- Bluetooth address is now a field on Region, offering the option of monitoring and ranging for all beacon transmissions from a known device's MAC Address
- Target SDK bumped to 23 for Android 6.0
- Adds hardware accelerated detection of Eddystone frames in the background on Android 5+
- Provides ability to forward BLE scan callbacks for non-beacon advertisements
Bug Fixes:
- Workaround for 500 alarm limit on Samsung devices.
- Fix NPE in scanning for beacons on Lollipop in the emulator
- Restart scanning after app is killed due to memory pressure
- Protect against crashes when falling behind on scans
- Protect against null pointer exceptions in race conditions
- Protect against crash when stopping advertising with bluetooth turned off
- Stop BLE scanning after stopping ranging of the last region
- Fix for NPE on Galaxy Note 4
- Keep from getting stuck in background mode after stopping and restarting service
- Protect against Null Pointer Exceptions when dynamically adding and removing monitored/ranged regions
- Protect against an underlying Android BLE bug that sometimes causes Null Pointer Exceptions when starting stopping scanning.
- Ignore corrupted beacon BLE packets instead of throwing an exception about them
- Use a private ThreadPoolExecutor for beacon scanning to avoid thread starving apps using AsyncTask
- Allow missing data fields, setting data values to zero if data fields missing in packet
- If a custom AltBeacon parser is supplied, don't crash with NPE if it is not found
- Android 5.x devices could not detect AltBeacons on with unusual manufacturer codes in versions 2.3 and 2.3.1 due to Android 5.x BLE scan filters being inadvertently enabled in the foreground.
- Improve handling of PDUs with unexpected lengths.
- Add ability to optionally shorteten Beacon identifiers if their max length can be longer than the PDU.
- Fix improper termination of URLs on URI Beacons causing an extra byte to show up on the end.
- Identifer.parse("0") is now handled properly. A bug in the previous release did not handle it properly leading to ranging/monitoring failures on regions with such an identifier.
- Switch BeaconParsers list to be a CopyOnWriteArrayList to avoid UnsupportedOperationException changing list after starting scanning.
- Fix crash when region has more identifiers than beacon
- Fix bugs with compressing Eddystone-URL to bytes and back
- Allow Regions to match beacons with fewer identifiers if the extra region identifiers are null. This allows matching Eddystone-UID and Eddystone-URL beacon with the default Region with three null identifiers. This started failing in version 2.6.
- Declare the ACCESS_COARSE_LOCATION permission in the manifest since it is required for Android 6.0. This is helpful to keep beacon detection working on Android 6.0 for apps that don't explicitly declare this in their own manifest.
- Fix rescheduling of alarms in the distant future so they don't inadvertently go off right away
If you notice an issue...
Please help the community by logging any issues you find.
- make sure that the issue hasn't already been logged against the original library
- if the original library works correctly, log an issue against the Xamarin binding
Can't wait to hear about the cool apps you build!