PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Retrieved properties
  • Notes
  • Operating mode in iPhone/iPad
  • Required permissions
  • Required application feature
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Asks to be regularly notified about the current device position.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Android Widget This function is now available in Android Widget mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// Branche une procédure pour recevoir régulièrement la position du périphérique
GPSFollowMovement(ProcDeplacement)
// Procédure
PROCÉDURE ProcDeplacement(pos is géoPosition)
 
Info(" Latitude: " + pos.Latitude)  
Info(" Longitude: " + pos.Longitude)
Syntax
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad

Enabling the notification mechanism (in a mobile) Hide the details

GPSFollowMovement(<WLanguage procedure> [, <Timeout> [, <Distance>]])
<WLanguage procedure>: Procedure name
Name of WLanguage procedure called at each notification.
This procedure has the following format:
PROCEDURE <Nom de la Procédure>(<Position>)
<Position> is a geoPosition variable containing information about the device position at the time of notification.
<Timeout>: Optional integer or optional Duration
Minimum timeout (in hundredths of a second) between two notifications. If this parameter is not specified, the minimum time-out will be set to 60 seconds.
Remark: This parameter can correspond to:
  • an integer corresponding to the number of hundredths of a second,
  • a Duration variable,
  • Versions 23 and later
    direct indication of the time (e.g. 1 s or 10 ms).
    New in version 23
    direct indication of the time (e.g. 1 s or 10 ms).
    direct indication of the time (e.g. 1 s or 10 ms).
Universal Windows 10 App This parameter is ignored.
<Distance>: Optional real
Minimum distance (in meters) between two notifications.
If this parameter is not specified, the minimum distance will be set to 5 meters.

Disabling the notification mechanism

GPSFollowMovement()
Remarks
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad

Retrieved properties

  • To find out whether the Speed, Accuracy, Direction or Altitude properties of a geoPosition variable have been filled when retrieving the position, use SpeedValid, AccuracyValid, DirectionValid and AltitudeValid.
  • To reinitialize a geoPosition variable, use VariableReset.
  • AndroidAndroid Widget iPhone/iPad It is recommended to initialize the location provider settings using the GPSInitParameter function before retrieving a position.
  • The positioning information that was retrieved corresponds to the last known device position: therefore, they may not correspond to the current device position if the device was moved while the GPS signal was not valid for example. It is possible to know the date and time at which the position was calculated thanks to the Property MeasurementDate of the Variable geoPosition.
  • Speed, Accuracy, Direction and Altitude will be specified only if the location provider allows it (otherwise, these properties will take their default value).
    AndroidAndroid Widget iPhone/iPad The location provider can be set using the GPSInitParameter function.
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad

Notes

  • Geolocation functions can consume a lot of resources on the device (battery, bandwidth, etc.). Therefore, we advise you not de define very small values for the minimum time-out and for the minimum distance between two notifications.
  • Versions 21 and later
    AndroidiPhone/iPad It is possible to perform geolocation tracking in the background without consuming resources via the functions geoTrackingEnable, geoTrackingDisable, geoTrackingStatus and geoTrackingProcedure. For more details, see Location tracking.
    New in version 21
    AndroidiPhone/iPad It is possible to perform geolocation tracking in the background without consuming resources via the functions geoTrackingEnable, geoTrackingDisable, geoTrackingStatus and geoTrackingProcedure. For more details, see Location tracking.
    AndroidiPhone/iPad It is possible to perform geolocation tracking in the background without consuming resources via the functions geoTrackingEnable, geoTrackingDisable, geoTrackingStatus and geoTrackingProcedure. For more details, see Location tracking.
  • iPhone/iPad When generating the application, it is possible to allow the GPSFollowMovement function to be called when the application is in the background (option "Allow GPSSuitDevice and BeaconPreciseDetect to be called when the application is in the background" in the "Configuration" step of the wizard).. In this case, the geolocation will continue when the application runs in the background or when the device is in standby mode. See Generating an iOS application for more details.
  • To stop receiving notifications, call GPSFollowMovement without parameter or call GPSEnd.
Versions 17 and later
iPhone/iPad

Operating mode in iPhone/iPad

When a GPS function is first run, the system requests geolocation permission from the user. If the user refuses, all the GPS functions used in the rest of the application will fail (fatal error).
To re-allow the use of GPS for this application, the system configuration of the application must be modified.
New in version 17
iPhone/iPad

Operating mode in iPhone/iPad

When a GPS function is first run, the system requests geolocation permission from the user. If the user refuses, all the GPS functions used in the rest of the application will fail (fatal error).
To re-allow the use of GPS for this application, the system configuration of the application must be modified.
iPhone/iPad

Operating mode in iPhone/iPad

When a GPS function is first run, the system requests geolocation permission from the user. If the user refuses, all the GPS functions used in the rest of the application will fail (fatal error).
To re-allow the use of GPS for this application, the system configuration of the application must be modified.
AndroidAndroid Widget

Required permissions

The call to this function modifies the permissions required by the application.
Required permission: ACCESS_FINE_LOCATION.
Android 10 specific case: Android 10 has implemented a new permission for the functions that allow locating the device: ACCESS_BACKGROUND_LOCATION.
This permission allows using the function when the application is in the background.
When this permission is added to the application, a window allows the user to:
  • allow access to the device location while the application is in the background,
  • allow access to the location only while the application is in use,
  • deny access to the location.
The user can also change these permissions at any time in the Android settings.
Android 11 specific case: The use of this function requires the implementation of the Permission: ACCESS_BACKGROUND_LOCATION allowing the location of the device.
This permission allows using the function when the application is in the background.
If the application requires background localization, you must:
  • Manually add the Permission "ACCESS_BACKGROUND_LOCATION" in the wizard generation of the Android application.
  • Explicitly request the Permission location in the background from the user with the PermissionRequest function. For example:
    PermissionRequest(permBackgroundLocation, Callback)
    INTERNAL PROCÉDURE Callback(p is Permission)
    IF p.Granted THEN
    // Utilisation possible des fonctions nécessitant la localisation en arrière-plan
    END
    END
A window allows the user to:
  • allow access to the device location while the application is in the background,
  • allow access to the location only while the application is in use,
  • deny access to the location. The user can also change these permissions at any time in the Android settings.

Remarks:
  • Follow Google's specifications for applications that use location in the background. For more details, see https://support.google.com/googleplay/android-developer/answer/9799150. If these conditions are not met (including user information requirements), applications may not be authorized for publication on the Play Store.
  • The Permission background location request should only be made if the Permission location has been granted. Otherwise, the PermissionRequest function will fail.
  • If the user's choice when requesting Permission to locate in the background is more restrictive than the choice made when requesting Permission to locate, the application will automatically be restarted.
  • On devices below Android 10, if the Permission location has been granted to the application, the Permission background location request will be granted without displaying a window.
Versions 21 and later
Universal Windows 10 App

Required application feature

When this function is used, an application feature is declared in the application generation wizard.
Required feature: Geolocation
This feature allows the applications to access the geolocation features found on the device or on the computer.
New in version 21
Universal Windows 10 App

Required application feature

When this function is used, an application feature is declared in the application generation wizard.
Required feature: Geolocation
This feature allows the applications to access the geolocation features found on the device or on the computer.
Universal Windows 10 App

Required application feature

When this function is used, an application feature is declared in the application generation wizard.
Required feature: Geolocation
This feature allows the applications to access the geolocation features found on the device or on the computer.
Related Examples:
Android GPS Android (WINDEV Mobile): Android GPS
[ + ] This example presents the use of the GPS functions of WLanguage in an Android application.
It is used to retrieve at regular interval:
- The latitude
- The longitude
- The altitude
- The speed
- The direction
WM Sports Cross-platform examples (WINDEV Mobile): WM Sports
[ + ] This example is a sport application used to save your performances.
The application calculates the distance, the time, the average speed and the number of calories spent according to the sport.
The run is displayed on a map control via markers and an itinerary.

The example also includes a server part used to synchronize the user data.
This webservice is available in the WEBDEV "WW_Sports" example.
Component: wd260java.dll
Minimum version required
  • Version 15
This page is also available for…
Comments
GPS Functions
https://forum.pcsoft.fr/fr-FR/pcsoft.br.windev/519-busca-endereco-rota-endereco-das-coordendas-523/read.awp?hl=enderecodascoordenadas

https://forum.pcsoft.fr/fr-FR/pcsoft.br.windev/2875-informatica-exemplo-google-maps-com-json-retornando-distancia/read.awp?lastview
BOLLER
10 Nov. 2018