Location

  • Description

      Location

      The Location Sensor is a non visible component that provides location information.

      • Longitude.
      • Latitude.
      • Altitude, if it is compatible with the device.
      • Address.

      This component can also perform "geocoding", converting a given address (not necessarily current) in a Latitude (with the procedure 'Latitude of the address') and a Longitude (with the procedure 'Longitude of the address').

      To work, the component must have its property 'Enabled' set to 'True', and the device must have location detection enabled, through networks wireless or satellite GPS (if outdoors). It is possible that the location information is not immediately available when it starts an application. You will have to wait a short time to find and use a provider location or wait for the event 'changing the location'.

  • Events

    • On Location Changed
    • Event that runs when a change is detected in the location.
    • Status Changed
    • Event that runs when the service's status provider of location has changed. This happens when you lose a provider or uses a new provider.
  • Procedures

    • Latitude From Adress
    • This method, allows to obtain the latitude of the given address.
    • Longitude From Adress
    • This method, allows to obtain the longitude of the given direction.
  • Properties

    • Current Address (number)
    • Allows to obtain the coordinates of latitude and longitude detected by the provider.
    • Distance Interval (number)
    • Determines the minimum distance, in meters, in which the sensor must to update the location.

      This is useful because if you do not set a minimum, the sensor continually be sending requests of change of location spending resources unnecessary of our device.
      If we set the interval to 10 meters, the sensor will only send requests when you have travel that distance, running the event 'On Location Changed'.

    • Time Interval (number)
    • Determines the minimum time interval, in which the sensor must to update the location. This value is determined in milliseconds.

      This is useful because if you do not set a minimum, the sensor continually be sending requests of change of location spending resources unnecessary of our device.
      If we set the interval to 5 minutes (300000 ms), the sensor will only send requests when you are after this time has elapsed, running the event 'On Location Changed'.

    • Accuracy (number)
    • It allows to determine the accuracy with which our device captures the location in meters.
    • Has Acuraccy (boolean)
    • Allows you to determine if the sensor location can connect to the provider of services. If the obtained value is 'True', you will be able to connect.
    • Altitude (number)
    • Allows you to find the altitude of the device in meters respect to the level of the sea.
    • Has Altitude (boolean)
    • Allows you to determine if the sensor location is able to obtain a altitude, so we will get the value 'True'.
    • Longitude (number)
    • Allows you to obtain the longitude of the device, their values are between -180 and 180 degrees.
    • Latitude (number)
    • Allows to get the latitude of the device, their values are between -90 and 90 degrees.
    • Has Longitude Latitude (boolean)
    • Allows you to determine if the sensor location is able to obtain a latitude and longitude, if so we will get the value 'True'.
    • Available Providers (list)
    • It allows to get a list of providers of location available allow the GPS.
    • Provider Name (Text)
    • Allows you to obtain the name of the provider GPS to which is connected the device.
    • Provider Locked (boolean)
    • If we get 'True', the provider of the current location will be blocked.
    • Enabled (boolean)
    • Allows you to enable or disable the sensor location of the device.
  • Example

    • Getting coordinates
    • We will configure the intervals (time and distance) when you open the activity, to update the location when the values specified are met. When this occurs, the values of longitude and latitude will be displayed on the screen.