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.
  • Special cases
  • Required permissions
  • Required application feature
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Asks to be notified when the device gets close to a given location.
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.
Versions 22 and later
WINDEVWindows This function is now available for WINDEV applications.
New in version 22
WINDEVWindows This function is now available for WINDEV applications.
WINDEVWindows This function is now available for WINDEV applications.
Versions 26 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 26
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Example
// Active la demande de notification
GPSDetectPosition(ProcDétection, 1.145258, 30.968745)
// Procédure appelée lors de la notification
PROCÉDURE ProcDétection(Entrée is boolean)
IF Entrée = True THEN
Info("Vous êtes arrivé à destination.")
END
Syntax
<Result> = GPSDetectPosition(<WLanguage procedure> , <Latitude> , <Longitude> [, <Radius> [, <Timeout>]])
<Result>: Integer
Detection identifier.
This identifier is used in the following cases:
  • to stop the notification mechanism. Simply pass this identifier as a parameter to GPSStopDetection.
  • to identify the location processed in the WLanguage procedure called (case where the same WLanguage procedure is used to process several locations).
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback" procedure) called when the device enters into or exits from the region delimited by the specified parameters.
For more details on this procedure, see Parameters of the procedure used by GPSDetectPosition.
<Latitude>: Real
Latitude of the proximity location.
<Longitude>: Real
Longitude of the proximity location.
<Radius>: Optional real
Radius (in meters), around the proximity location, from which the notification is to be generated.
If this parameter is not specified, the radius around the location will be set to 50 meters.
<Timeout>: Optional integer or optional Duration
Timeout (in hundredths of a second) of the proximity alert. This timeout starts from the call to the function.
  • No timeout will be defined if this parameter is set to -1 or if it is not specified.
  • If this timeout is specified, the notification mechanism will automatically stop at the end of the timeout.
This parameter can correspond to:
  • an integer corresponding to the number of hundredths of a second,
  • a Duration variable,
  • Versions 23 and later
    the duration in a readable format (e.g., 1 s or 10 ms).
    New in version 23
    the duration in a readable format (e.g., 1 s or 10 ms).
    the duration in a readable format (e.g., 1 s or 10 ms).
Remarks

Special cases

  • To stop receiving notifications, use GPSEnd.
  • To stop detecting the proximity of a specific location;
    • return False in the associated WLanguage procedure,
    • use the GPSStopDetection function.
  • You can detect the proximity to multiple locations by calling GPSDetectPosition for each location. If the same procedure is called for several locations, it is possible to differentiate these locations in the WLanguage procedure with the <Detection identifier> parameter. This parameter corresponds to the result of GPSDetectPosition.
  • Location measurements can be more or less accurate depending on the parameters of the location provider. Therefore, it may happen that no notification is sent if the device briefly passes near the monitored area. Similarly, a notification may be received if the device comes very close to the monitored area without entering it.
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: 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 PROCÉDURE Callback(p is Permission)
    IF p.Granted THEN
    // Functions that require background location access can be used
    END
    END
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.

Remarks:
  • Follow Google's guidelines for applications that require background location access. For more details, see https://support.google.com/googleplay/android-developer/answer/9799150. 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.
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.
Business / UI classification: Business Logic
Component: wd270java.dll
Minimum version required
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment