PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Use conditions
  • Special cases
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
SensorDetectEndBumps (Function)
In French: CapteurDétecteFinSecousses
Used to be notified when bumps occur on the device on any one of its 3 axes.
Versions 17 and later
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 17
Universal Windows 10 App This function is now available for the Windows Phone applications.
Universal Windows 10 App This function is now available for the Windows Phone 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 19 and later
WEBDEV - Browser code This function is now available in Browser code.
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 19
WEBDEV - Browser code This function is now available in Browser code.
iPhone/iPad This function is now available for the iPhone/iPad applications.
WEBDEV - Browser code This function is now available in Browser code.
iPhone/iPad This function is now available for the iPhone/iPad applications.
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
// Detect the end of bumps
SensorDetectEndBumps("ProcBumpDetection")
// ProcBumpDetection procedure
PROCÉDURE ProcBumpDetection(nDuration is int)
ToastDisplay(StringBuild("End of bumps. Duration: %1 thousands of a second", nDuration))

// End of bump detection
SensorDetectEndBumps("")
Syntax
<Result> = SensorDetectEndBumps(<Procedure Name> [, <Sensitivity> [, <Duration of Beginning of Bump> [, <Interval>]]])
<Result>: Boolean
  • True if the detection of end of bumps was triggered,
  • False otherwise.
<Procedure Name>: Character string (with or without quotes)
Name of WLanguage procedure ("callback" procedure) that will be called when the device stops to be shaken. This procedure has the following format :
PROCEDURE <Procedure Name>(<Duration>)
where <Duration> is an integer corresponding to the duration of bumps (in thousands of a second).
The parameters of this procedure are optional. There is no need to pass parameters to this procedure. Indeed, these parameters are automatically filled during each call
If the procedure name corresponds to an empty string (""), the detection of end of bumps will be stopped.
<Sensitivity>: Optional integer or optional Integer constant
Indicates the sensitivity level to the bumps. Corresponds to:
  • value included between 0 and 2000: 0 for a very high sensitivity to the bumps, 2000 for a very low sensitivity to the bumps.
  • one of the following constants:
    snrSensitivityHighHigh sensitivity to bumps. Even a low device shaking will trigger the notification.
    snrSensitivityLowLow sensitivity to bumps. Only a strong device shaking will trigger the notification.
    snrSensitivityNormal
    (Default value)
    Standard sensitivity to bumps
<Duration of Beginning of Bump>: Optional integer or optional Duration
Minimum duration (in thousands of a second) during which the device must be shaken before starting the detection of bumps. By default, the minimum duration is set to 200 thousands of a second.
This parameter can correspond to:
  • an integer corresponding to the number of thousands of a second,
  • a Duration variable,
  • Versions 23 and later
    the direct indication of duration (1 s or 10 ms for example).
    New in version 23
    the direct indication of duration (1 s or 10 ms for example).
    the direct indication of duration (1 s or 10 ms for example).
<Interval>: Optional integer or optional Duration
Maximum time interval (in thousands of a second) during which the bumps of the device can stay below the specified sensitivity level before triggering a notification for end of bumps. By default, the maximum duration is set to 200 thousands of a second.
This duration can correspond to:
  • an integer corresponding to the number of thousands of a second,
  • a Duration variable,
  • Versions 23 and later
    the direct indication of duration (1 s or 10 ms for example).
    New in version 23
    the direct indication of duration (1 s or 10 ms for example).
    the direct indication of duration (1 s or 10 ms for example).
Remarks

Use conditions

  • AndroidAndroid Widget This function cannot be used in the emulator or in the simulator. In both cases, the result of the function will always be set to False.
  • iPhone/iPad This function cannot be used in the iOS simulator. In this case, the function result will always correspond to False.
  • The mechanism for bump detection is using the accelerometer sensor found on the device. No bump detection will be performed if this sensor is not found on the device. The sensitivity of detection depends on the quality of the sensor found in the device.

Special cases

  • If a detection for end of bumps (triggered by SensorDetectEndBumps) and a detection for beginning of bumps (triggered by SensorDetectBeginningBumps) are performed at the same time, the parameters used (<Sensitivity>, <Duration of Beginning of Bump> and <Interval>) are the same in both cases. The values taken into account are the ones specified by the function called last.
  • We advise you to stop the bump detection when it is no longer required in order to save the device battery. To do so, <Procedure Name> must correspond to an empty string ("").
    SensorEnd is used to stop all the current detections.
Components
WEBDEV - Browser code WDJS.DLL
Android wd230android.jar
Minimum required version
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment