Class LocationGeotriggerFeed


  • public final class LocationGeotriggerFeed
    extends GeotriggerFeed
    Feed data for a Geotrigger created from a LocationDataSource.

    The GeotriggerFeed is the dynamic component of a Geotrigger. Typically, it is the data that moves around and triggers the condition. For example, if the condition is "notify me when my position comes within 50 meters of one of my areas of interest", the feed data is "my position".

    To receive location updates, the LocationDataSource must be LocationDataSource.started. If you call GeotriggerMonitor.stop(), the underlying LocationDataSource will not be stopped for you. For example, it may continue to receive GPS readings.

    Since:
    100.12.0
    • Constructor Detail

      • LocationGeotriggerFeed

        public LocationGeotriggerFeed()
        Constructs an empty LocationGeotriggerFeed.
        Since:
        100.12.0
      • LocationGeotriggerFeed

        public LocationGeotriggerFeed​(LocationDataSource locationDataSource)
        Constructs a LocationGeotriggerFeed with a LocationDataSource.
        Parameters:
        locationDataSource - a location data source that provides updates for the device location
        Throws:
        IllegalArgumentException - if locationDataSource is null
        Since:
        100.12.0
    • Method Detail

      • getLocationDataSource

        public LocationDataSource getLocationDataSource()
        Gets the location data source that provides updates for the device location.

        To receive location updates, the LocationDataSource must be LocationDataSource.isStarted(). If you call GeotriggerMonitor.stop(), the underlying LocationDataSource is not stopped for you. In other words, it may continue to receive GPS readings.

        Returns:
        the location data source that provides updates for the device location, or null if none
        Since:
        100.12.0
      • setLocationDataSource

        public void setLocationDataSource​(LocationDataSource locationDataSource)
        Sets the location data source that provides updates for the device location.

        To receive location updates, the LocationDataSource must be LocationDataSource.isStarted(). If you call GeotriggerMonitor.stop(), the underlying LocationDataSource is not stopped for you. In other words, it may continue to receive GPS readings.

        Parameters:
        locationDataSource - the location data source that provides updates for the device location
        Since:
        100.12.0