|
|
|
|
- Overview
- Implementation
- In the editor
- Programmatically
- Operating mode
- Specific features
- Android specific features
- Specific features for iOS
Continuing to run a process when the application is in background is very useful on mobile: - appointment reminder (display a notification),
- turnover calculation in real time,
- data retrieval, ...
The process must be found in a procedure. All you have to do is specify the frequency at which this procedure will be run. Between the calls, the procedure consumes no battery and no CPU. In the editor To automate a procedure: - Display the code of the procedure.
- Open the description window of the procedure automations:
- Click in the procedure bar.
- Select "Configure the automated processes of the procedure" in the context menu of the procedure ("Project explorer" pane).
- Select "Properties" in the context menu of the procedure in the "Code" pane.
- In the window that appears, select the automation type: "Periodic execution when the application is in background".
- Specify the time interval (in minutes). This interval is the minimum time interval between two task executions. Used to guarantee that the task will not be run during this time interval. However, the system can increase the time interval according to several factors (important workload, low battery, etc.). Therefore, the real time interval can change and it can be quite long (several hours).
- Validate.
Programmatically Remark: You can also handle background tasks using the following functions:
Operating mode Once added, the background task is automatically run by the system at regular time interval. The task is persistent, it will continue to be run periodically when the application is stopped, even when the device is restarted. If the task is triggered while the application is not started, the application will be run in background (without opening the first project window), the initialization process of project and the declaration process of classes and sets of procedures will be run before calling the procedure associated with the task. The task will be run when the application is not started or when the application is in background. If the application is displayed in the foreground, its execution will be postponed. As the task can be run in a secondary thread of the application, the code of the WLanguage procedure must not contain an access to the application's UI or open dialog boxes (via Info, Error, etc.). If the task must interact with the users, you can use notifications ( Notifxxx functions).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|