Help / WLanguage / WLanguage functions / Standard functions / Geolocation functions
  • Remarks
  • Required permissions
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Enables the management of location tracking in a WINDEV Mobile application.
// Enable the push notifications
// Manage location tracking
PROCEDURE ValidateTrackingActivation(bTrackingEnabled is boolean, cError is string)
IF NOT bTrackingEnabled THEN
STC_Loc = "Location enabled"
geoTrackingEnable(<WLanguage procedure>)
<WLanguage procedure>: Procedure name
Name of WLanguage procedure called:
  • when the deactivation was performed,
  • if an error occurred:
    • iPhone/iPadIOS WidgetMac Catalyst activation request refused by the user.
    • Android erreur while accessing the Google Play Services.
This procedure has the following format:
PROCEDURE <Procedure name>(<Tracking enabled> is boolean, <Error> is string)
  • <Tracking enabled> is a boolean indicating whether tracking is enabled (True) or not (False).
  • <Error> is a character string corresponding to the text of the activation error. This parameter is initialized only if <Tracking enabled> is set to False.


  • This function is asynchronous.
  • iPhone/iPadIOS WidgetMac Catalyst This function can be used only if the location rights have been granted to the application. These rights are enabled during the generation.
  • Android Starting with Android 8, to reduce the applications' battery usage, the system drastically limits the frequency for receiving device locations when the application is running in the background. For more details, see

Required permissions

Android 11 specific case: This function requires the ACCESS_BACKGROUND_LOCATION permission to access the device's location.
This permission allows using the function when the application is in the background.
If the application needs to use background location:
  • Manually add the "ACCESS_BACKGROUND_LOCATION" permission in the Android application generation wizard.
  • Explicitly request background location permission with PermissionRequest. For example:
    PermissionRequest(permBackgroundLocation, Callback)
    INTERNAL PROCEDURE Callback(p is Permission)
    IF p.Granted THEN
    // Functions that require background location access can be used
A window allows users 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.

  • Follow Google's guidelines for applications that require background location access. For more details, see If these conditions are not met (especially user information requirements), applications may not be accepted for publication on Google Play.
  • The background location permission should only be requested if the location permission has been granted. Otherwise, PermissionRequest will fail.
  • If the option chosen by the user for the background location access request is more restrictive than the option chosen for the location access request, the application will be automatically restarted.
  • On devices running Android 10 or earlier, if location permission has been granted to the application, the background location permission will be granted without displaying a window.
Related Examples:
WM Geolocation Cross-platform examples (WINDEV Mobile): WM Geolocation
[ + ] This example explains how to perform proximity searches with geolocation :
- search around me
- search in a city, at a given address, or close to a specific address.
The results are displayed in a looper and in a map with markers.
Component: wd300android.aar
Minimum version required
  • Version 21
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help