Git Product home page Git Product logo

Comments (6)

davidgyoung avatar davidgyoung commented on August 20, 2024

I will investigate

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

This mechanism for setting the distance calculator will soon be deprecated and replaced int the 3.0 version of the library.

In the mean time, I think this can be solved by wrapping the code that sets it in an if block like this:

if (Beacon.getDistanceCalculator == null) {
        DistanceCalculator defaultDistanceCalculator =  new ModelSpecificDistanceCalculator(this, BeaconManager.getDistanceModelUpdateUrl());
        Beacon.setDistanceCalculator(defaultDistanceCalculator);
}

from android-beacon-library.

gerardmundo-birket avatar gerardmundo-birket commented on August 20, 2024

Hi David,

Yes, this would work!

Thank you for looking into it.

PS: I'm curious about how v3 will work (not just with the calculator!)

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

Fixed in #1191

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

@gerardmundo-birket an example of the new settings api for the distance calculator is visible in the working branch here:

https://github.com/AltBeacon/android-beacon-library/blob/settings-api/lib/src/test/java/org/altbeacon/beacon/SettingsTest.kt#L127

As you can see, instead of setting a class name, the settings pass a custom DistanceClaculatorFactory instance that is responsible for constructing the new custom DistanceCalculator.

from android-beacon-library.

gerardmundo-birket avatar gerardmundo-birket commented on August 20, 2024

Hi David!

Ah, elegant solution!
I appreciate the fix.

Once again, thank you very much, and looking forward to v3!

from android-beacon-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.