PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Overview
  • Available project elements
  • Available controls
  • Databases
  • Application menus
  • Popup menus
  • Modal windows
  • Managing the "Back" and "Home" buttons
  • Back button
  • Home button
  • Notification about the application inactivity
  • Operating mode of focus and selection
  • Loopers
  • Automatic scrollbars in the windows
  • Using a native Java code in an Android application
  • Types of function parameters
  • Management of directories
  • Change of screen orientation
  • Various
  • Managing threads
  • Indirection operators
  • Use of native Android fonts
  • Managing ADB logs
  • Debugging deployed applications via the ADB logs
  • Print in PDF format
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
Available project elements
The following project elements are available for the Android development:
  • Windows.
  • Queries.
    Note: in a query with parameters, all the parameters are mandatory.
  • Classes.
  • Sets of procedures.
  • Window templates.
The following elements are not available for the Android development:
  • External components.
    Note: The internal components are available for the Android development. However, if the internal component includes an analysis, this analysis will be ignored during the execution.
  • Reports and report templates.
  • Control templates.
  • Internal windows.

Available controls

The following controls are available for the Android development:
  • Button
  • Combo box
    Note: A negative value or a null value cannot be assigned to a combo box. An element must necessarily be selected if the combo box is not empty. An error will occur if a negative value or a null value is assigned to a combo box.
  • Image
  • Check box
  • Static
  • List box
  • Tab
  • Edit control
  • Radio button
  • Looper
    Note: The Looper controls are used to replace the Table controls in an Android application. Indeed, the concept of "Table control" does not exist in Android. The Table controls are not used in Android for the following reasons:
    • The interface of Table controls is not suitable.
    • Problem regarding the space in the windows: the columns and the column headers would not be displayed.
    • The row height would be too small to be handled with the fingers.
    • The Table controls are not used in the interface standard of this system.
Versions 19 and later
Versions 20 and later
New in version 20
Versions 21 and later
New in version 21
Notes:
  • Some style properties ("Style" tab of the description window of controls), although available in edit, are not supported by the Android applications.
  • Versions 21 and later
    When defining the background color of control borders, you have the ability to use a gradient background color.
    New in version 21
    When defining the background color of control borders, you have the ability to use a gradient background color.
    When defining the background color of control borders, you have the ability to use a gradient background color.
Databases
The databases of the Android applications must be in SQLite format. SQLite is the database system supplied with the Android operating system.
WINDEV Mobile includes a native access for SLQLite for Android. The main Hxxx commands are available.
For the Android applications, the available databases are:
  • HFSQL (Classic and Client/Server),
  • SQLite.
    WINDEV Mobile includes a native access for SLQLite for Android. The main Hxxx commands are available.
Notes:
  • SQLite database: If your Android project shares its analysis with another (non-Android) project, HChangeConnection can be used to associate the application files with a SQLite connection. See Android application: Using and sharing data for more details.
  • Managing memos with SQLite: Storing information in memo format is recommended for the data whose size is less than 1 MB. We advise you to directly save the data in external file format on the internal or external memory of the phone and to store the access path to this data in the database.
  • Versions 19 and later
    You also have the ability to access an external database (Oracle, SQL Server, ...) via a Webservice. See Accessing a database via a Webservice for more details.
    New in version 19
    You also have the ability to access an external database (Oracle, SQL Server, ...) via a Webservice. See Accessing a database via a Webservice for more details.
    You also have the ability to access an external database (Oracle, SQL Server, ...) via a Webservice. See Accessing a database via a Webservice for more details.
Application menus
In an Android application, the application options can be proposed:
  • via the Action Bar control. This solution is recommended.
  • in menu format (not recommended).
Notes about the menus:
  • In edit, the menus of the Android windows are presented like simple drop-down menus.
  • At run time, these menus will be displayed differently according to the number of options:
    • If the menu contains less than 6 options, it is displayed like large buttons at the bottom of the screen.
    • If the menu contains more than 6 options, the first 5 options are displayed like large buttons and a sixth automatic button ("Plus") allows the user to see the rest of the menu like a drop-down menu.
  • The menus of the Android applications support a single level of sub-menus. Beyond this limit, a fatal error occurs when running the application.

Popup menus

The popup menus are supported by WINDEV Mobile for the Android applications.
  • In edit, they are presented like Windows drop-down menus but they adopt the appearance of Android menus at run time.
  • They are also limited to a single level of sub-menu.
  • On the devices without "right click" (phones for example), the popup menus are displayed after a "long press" on the control to which they are associated.
Modal windows
The modal widows are not supported by the Android operating system. Open is not allowed.
The windows can be opened:
To pass a return value:
  • When it is closed, a child or sibling window can call a local procedure of the window that opened it in order to pass a return value to it. A return value can also be returned via a global variable.
  • Versions 18 and later
    You have the ability to specify the return value via the ..ReturnedValue property of child window and to retrieve this value via the "Closing a child window of the window" process of parent window.
    New in version 18
    You have the ability to specify the return value via the ..ReturnedValue property of child window and to retrieve this value via the "Closing a child window of the window" process of parent window.
    You have the ability to specify the return value via the ..ReturnedValue property of child window and to retrieve this value via the "Closing a child window of the window" process of parent window.
Managing the "Back" and "Home" buttons

Back button

All the devices operating in Android include a special "Back" key (symbolized in most cases by a little arrow pointing to the left). In a WINDEV Mobile application, this key closes the current window and runs the "Window closing" process. If it is the first application window, the closing code of the application will be run and the application will be closed.
An application must be developed in order to behave properly if any of its windows is closed via the "Back" key. In most cases, each window control must be initialized with a default value and the "Back" button must be considered as being a "Cancel" button.
Note: You have the ability to change this behavior and to run a custom process (to ask confirmation to the user for example and to avoid closing the window especially if it is the first application window). To do so, the window must include a button whose shortcut is "'Back' button" ("GUI" tab in the description window of the control).

Home button

Pressing the "Home" button does not close the current application: the application is placed in the background. Therefore, the "Window closing" process is not run.
Note: Even if the window includes a button whose shortcut (defined in the GUI tab) is "'Home' button", the code of this button will not be run, unlike the Back button, the default behavior cannot be changed.
A long press on the "Home" key allows you to display the list of applications run. Then, the user can select his application when he wants to display it to the foreground.
Note: The Android system does not allow to propose this option by programming.
Notification about the application inactivity
The Android operating system does not allow an application to remain in a process (without giving control back to the operating system) for more than a few seconds. If this case occurs, Android displays a dialog box allowing the user to close the application or to wait for the end of the process:

Android: Application Non Responsive
To avoid triggering this mechanism, the calculation steps must not be included in the main thread of the application. To do so, use procedures started in secondary threads (see ThreadExecute for more details).
Note: We do not advise you to handle the elements of the application GUI from a secondary thread.
The Android designers recommend that a user action triggers a reaction from the application in less than 200 milliseconds to give a good impression of reactivity.
Operating mode of focus and selection
To manage both the GUIs controlled with the finger (or with a stylus) and the GUIs used with a keyboard and a trackball, Android offers a system for managing the focus and the selection that differs from the other operating systems:
  • The focus can only be moved with a mouse, a trackball or a similar device.
  • When the focus is moved, the entry and exit processes of the controls are run.
  • The clickable but non-editable controls (buttons, list boxes, etc.) behave like the controls in interruption. They do not take focus when they receive a click.
  • The "Row selection" process in the list boxes and in the loopers is run only when the row is selected by a click.
  • The "Row selection" process in the list boxes and in the loopers is not run when the row with focus changes.
Caution: In a list box or in a looper, the bar does not represent the selection but the focus.
Loopers
In the Android applications, the Looper controls are always "Read-only".In the Android applications, the Looper controls can be in edit.
Note: The Looper controls are used to replace the Table controls in an Android application. Indeed, the concept of "Table control" does not exist in Android. The Table controls are not used in Android for the following reasons:
  • The interface of Table controls is not suitable.
  • Problem regarding the space in the windows: the columns and the column headers would not be displayed.
  • The row height would be too small to be handled with the fingers.
  • The Table controls are not used in the interface standard of this system.
Automatic scrollbars in the windows
If the size of a window exceeds the size of the screen and if "Automatic scrollbars" is checked in the window description, a scrollbar is automatically added to the right of the window. Its presence must be taken into account when designing the window in order for this scrollbar not to overlay the controls.
Using a native Java code in an Android application
Native Java code can be used in an Android application.
The procedure is as follows:
  1. Create a global procedure in your project.
  2. In the header of the procedure, click the "WL" symbol to change the type of code from WLanguage to Java:
    Native Java before
  3. The procedure in Java code is displayed:
    Native Java after
  4. Type the Java code in the code editor of WINDEV Mobile.
Notes:
  • If the Java code entered requires specific permissions, they must be explicitly defined when generating the application. See Generating an application for Android for more details.
  • The classes and methods of the Android SDK often handle a reference on a "Context" object. In an Android project, during the input of native code, you have the ability to retrieve a "Context" object by obtaining a reference on the current activity or on the application context via the following methods that can be directly called in the code of the procedure in native code:
    // Retrieve the current activity
    getCurrentActivity()

    // Retrieve the current "Context"
    getApplicationContext()
  • To retrieve the View object corresponding to the main component of a control, you must use the getView method while passing the name of the control.
    Example: The following code returns the instance of the "Button" class used by the control:
    getView("BTN_Button1")
Types of function parameters
In Android, the declarations of the type of parameters for the procedures and for the methods of classes are ignored when compiling the application.
Therefore, you cannot:
  • declare an advanced parameter and use its properties directly.
  • declare a parameter of a given type and use another type.
Such use will trigger a runtime error. You must pass via a local intermediate variable.
For example, in the following code:
PROCEDURE MyProcedure(dtStartDate is DateTime)
Info(DateToString(dtStartDate..Date))
the declaration of the DateTime type is ignored. A runtime error will be displayed if the parameter passed to the procedure is not a DateTime.
We advise you to write:
PROCEDURE MyProcedure(dtStartDate)

// Declaration code of variables
// Used to perform the type conversion if necessary

dtLocalStartDate is DateTime
dtLocalStartDate = dtStartDate

Info(DateToString(dtLocalStartDate..Date))
Management of directories
The management of directories in Android presents the following specific features:
  • By default, the current directory of an application corresponds to the "files" sub-directory that is automatically created at the root of the setup directory of the application.
  • The relative paths handled by the application are relative to this directory.
  • The full path of current directory is returned by fCurrentDir. By default, you have the ability to read and write in this directory.
  • The current directory can be modified by fCurrentDir.
  • The runtime directory (returned by fExeDir) corresponds to the setup directory of the application. By default, the applications are always installed in the /data/data/<package name>.<application name> directory.
  • In Android, the file system is read-only on the device and on the emulator. An application has the rights to write into its setup directory or into one of its sub-directories, as well as onto the external memory (SDCard).
  • The "databases" directory is also automatically created at the root of the setup directory of the application to store the SQLite databases handled by the application (unless a specific path was specified during the connection). The path of "databases" directory is returned by fDataDir.
  • To have a storage location common to several applications, use the external memory (SDCard for example). The path of external memory is returned by SysDirStorageCard. To have a storage location common to several applications, use the external memory (SDCard for example). The path of a directory for storing files in the external storage space is returned by SysDirExternalStorage.
  • If the user connects his device to the PC in "mass storage" mode (or in "disk drive" mode), the SD Card is automatically uninstalled from the device and it is no longer accessible from the device. All the applications installed on the SD Card and currently operating are killed. As long as the SD Card is uninstalled, you cannot:
    • start the applications installed on the SD Card.
    • access the SDCard from the applications run on the phone.
For more details, see:
Change of screen orientation
To detect the change of screen orientation, use the process for resizing the windows.
Versions 16 and later
You also have the ability to use the SensorXXXX functions to detect the movements of the phone.
New in version 16
You also have the ability to use the SensorXXXX functions to detect the movements of the phone.
You also have the ability to use the SensorXXXX functions to detect the movements of the phone.
Note: The family of GPS functions allows you to manage the geo-localization of the phone.
Various
  • In Android, for security reasons, the "Home" and "End of call" keys cannot be used as shortcuts.
  • Versions 17 and later
    The "ActivAndroid 4-HoloDark" and "ActivAndroid 4-HoloLight" skin templates allow you to use the available holographic themes from Android 4. If the application is used with an Android version that supports the holographic themes, the theme is natively used for the application. Otherwise, the WINDEV Mobile skin template and the images of the selected skin template will be used.
    New in version 17
    The "ActivAndroid 4-HoloDark" and "ActivAndroid 4-HoloLight" skin templates allow you to use the available holographic themes from Android 4. If the application is used with an Android version that supports the holographic themes, the theme is natively used for the application. Otherwise, the WINDEV Mobile skin template and the images of the selected skin template will be used.
    The "ActivAndroid 4-HoloDark" and "ActivAndroid 4-HoloLight" skin templates allow you to use the available holographic themes from Android 4. If the application is used with an Android version that supports the holographic themes, the theme is natively used for the application. Otherwise, the WINDEV Mobile skin template and the images of the selected skin template will be used.
    All the skin templates apply the holographic theme from Android 5.
    Note: To use the "Material Design" theme, in the "General" tab of the description of the Android configuration, check "Apply the Material Design theme to the native controls and to the Info/Error/Dialog windows (requires Android 5.0 or later)".
  • Versions 20 and later
    Managing images according to the DPI: The images can be bit-mapped or blurred according to the DPI of the device. You have the ability to use the automatic management of DPI. See Android/iOS: Providing an image per DPI for more details.
    New in version 20
    Managing images according to the DPI: The images can be bit-mapped or blurred according to the DPI of the device. You have the ability to use the automatic management of DPI. See Android/iOS: Providing an image per DPI for more details.
    Managing images according to the DPI: The images can be bit-mapped or blurred according to the DPI of the device. You have the ability to use the automatic management of DPI. See Android/iOS: Providing an image per DPI for more details.
Managing threads
ThreadStop is not available in Android.
The thread can stop itself by exiting from the WLanguage procedure called by ThreadExecute.
Example:
ThreadExecute("th", threadNormal, ProcThread)
PROCEDURE ProcThread

bThreadAlive is boolean = True
WHILE bThreadAlive

// ... Process

// Checks the end condition of the thread
IF <THREAD END CONDITION> THEN
bThreadAlive = False
END
END
Indirection operators
The indirections are supported on the global variables only.
An indirection on a local variable of a process will trigger an "unknown element" error.
Use of native Android fonts
Versions 19 and later
The following fonts can be used:
  • Droid Sans -> all Android versions
  • Droid Sans Mono-> all Android versions
  • Droid Serif -> all Android versions
  • Roboto -> from Android 4.0 (Ice Cream Sandwich, api level 14)
  • Roboto Condensed -> from Android 4.1 (Jelly Bean, api level 16)
  • Roboto Light -> from Android 4.1 (Jelly Bean, api level 16)
  • Roboto Thin -> from Android 4.2 (Jelly Bean MR1, api level 17)
If the specified font is not supported at run time on the device, a substitution font will be used (Droid Sans or Roboto from Android 4.0)
New in version 19
The following fonts can be used:
  • Droid Sans -> all Android versions
  • Droid Sans Mono-> all Android versions
  • Droid Serif -> all Android versions
  • Roboto -> from Android 4.0 (Ice Cream Sandwich, api level 14)
  • Roboto Condensed -> from Android 4.1 (Jelly Bean, api level 16)
  • Roboto Light -> from Android 4.1 (Jelly Bean, api level 16)
  • Roboto Thin -> from Android 4.2 (Jelly Bean MR1, api level 17)
If the specified font is not supported at run time on the device, a substitution font will be used (Droid Sans or Roboto from Android 4.0)
The following fonts can be used:
  • Droid Sans -> all Android versions
  • Droid Sans Mono-> all Android versions
  • Droid Serif -> all Android versions
  • Roboto -> from Android 4.0 (Ice Cream Sandwich, api level 14)
  • Roboto Condensed -> from Android 4.1 (Jelly Bean, api level 16)
  • Roboto Light -> from Android 4.1 (Jelly Bean, api level 16)
  • Roboto Thin -> from Android 4.2 (Jelly Bean MR1, api level 17)
If the specified font is not supported at run time on the device, a substitution font will be used (Droid Sans or Roboto from Android 4.0)
Managing ADB logs

Debugging deployed applications via the ADB logs

When an application is deployed, the possible application errors that occur on the user computers are made available to the application developer in the "ADB log" .
This allows you to retrieve the errors as well as Asserts and traces for all the devices that run the application. The following messages are written into the ADB log:
  • Messages of Trace ("Info" level).
  • Messages of dbgStandardOutput ("Debug" level).
  • Versions 22 and later
    Messages of asserts (dbgAssert, dbgCheckxxx, dbgError) ("Assert" level).
    New in version 22
    Messages of asserts (dbgAssert, dbgCheckxxx, dbgError) ("Assert" level).
    Messages of asserts (dbgAssert, dbgCheckxxx, dbgError) ("Assert" level).
  • Versions 22 and later
    Messages of fatal and non-fatal errors ("Error" level).
    New in version 22
    Messages of fatal and non-fatal errors ("Error" level).
    Messages of fatal and non-fatal errors ("Error" level).
The "ADB log" is accessible:
  • on each phone. Specific software are used to process and view the content of this file.
  • via the "Monitor" tool available in the Android SDK. In this case, you have the ability to view (in the "Log cat" tab) the ADB logs of all applications found on the device connected to the PC (the "USB debug" mode must be enabled on the device). See Preparing the phone to run the test of an Android application for more details).
Print in PDF format
The PDF prints support the standard Adobe fonts only (no Unicode format): Courrier, Helvetica, Times, Symbol and ZapFDingbats.
Minimum required version
  • Version 15
Comments
Click [Add] to post a comment