Class ModelSpecificDistanceCalculator

  • All Implemented Interfaces:
    DistanceCalculator

    public class ModelSpecificDistanceCalculator
    extends Object
    implements DistanceCalculator
    Obtains a DistanceCalculator appropriate for a specific Android model. Each model may have a different Bluetooth chipset, radio and antenna and sees a different signal level at the same distance, therefore requiring a different equation coefficients for each model. This class uses a configuration table to look for a matching Android device model for which coefficients are known. If an exact match cannot be found, this class will attempt to find the closest match possible based on the assumption that an unknown model made by Samsung, for example might have a different signal response as a known device model also made by Samsung. If no match can be found at all, the device model marked as the default will be used for the calculation. The configuration table is stored in model-distance-calculations.json For information on how to get new Android device models added to this table, please see Created by dyoung on 8/28/14.
    • Constructor Detail

      • ModelSpecificDistanceCalculator

        public ModelSpecificDistanceCalculator​(Context context,
                                               String remoteUpdateUrlString)
        Obtains the best possible DistanceCalculator for the Android device calling the constructor
      • ModelSpecificDistanceCalculator

        public ModelSpecificDistanceCalculator​(Context context,
                                               String remoteUpdateUrlString,
                                               AndroidModel model)
        Obtains the best possible DistanceCalculator for the Android device passed as an argument
    • Method Detail

      • getModel

        public AndroidModel getModel()
        Returns:
        the Android device model used for distance calculations
      • getRequestedModel

        public AndroidModel getRequestedModel()
        Returns:
        the Android device model requested to be used for distance calculations