ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing for Android
  • Overview
  • Available project elements
  • Available controls
  • Databases
  • Application menus
  • Context menus
  • Modal windows
  • Managing the "Back" and "Home" buttons
  • Back button
  • Home button
  • Notification about the application inactivity
  • Operating mode of focus and selection
  • Automatic scrollbars in the windows
  • Management of directories
  • Changing the screen orientation
  • Miscellaneous
  • Thread management
  • Indirection operators
  • Using native Android fonts
  • Managing ADB logs
  • Debugging deployed applications via the ADB logs
  • Printing to PDF
  • API level
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Available project elements
The following project elements are available for Android development:
  • Windows.
  • Queries.
    Note: in a parameterized query, all parameters are mandatory.
  • Classes.
  • Sets of procedures.
  • Window templates.
The following elements are not available for Android development:
  • External components.
    Remarque: Internal components are available for Android development. However, if the internal component includes an analysis, this analysis will be ignored during the execution.
  • Reports and report templates.

Available controls

The following controls are available for Android development:
Remarks:
  • Some style properties ("Style" tab of control description windows), although available in edit mode, are not supported by Android applications.
  • You can use a gradient for the background color of the control borders.
Databases
The databases available for Android applications are:
  • HFSQL (Classic and Client/Server),
  • SQLite.
    WINDEV Mobile includes a Native Connector for SLQLite for Android. The main Hxxx commands are available.
Remarks:
  • Memo management with HFSQL: The Unicode or ANSI runtime string usage mode defined in project configuration determines the character set used for storage. By default, ANSI strings assigned to HFSQL memo items are encoded in UTF-8. ChangeCharset can be used to change the character encoding
  • SQLite database: If your Android project shares its analysis with another (non-Android) project, you can use the HChangeConnection function to associate the application's data files with an SQLite connection.. For more details, see Android application: Using and sharing data.
  • Memo management with SQLite: Storing information in the form of memos is recommended only for small amounts of data (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.
  • You also have the ability to access an external database (Oracle, SQL Server, ...) via a web service. For more details, see Accessing a database via a web service.
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 runtime, 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 menu like a drop-down menu.
  • The menus of Android applications support a single level of submenus. Beyond this limit, a fatal error occurs when running the application.

Context menus

The context menus are supported by WINDEV Mobile for the Android applications.
  • In edit mode, they are presented like Windows drop-down menus but they adopt the appearance of Android menus at runtime.
  • They are also limited to a single submenu level.
  • On the devices without "right click" (phones for example), the context 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. The Open function is not allowed.
The windows can be opened:
To pass a return value:
  • When closed, a child or sibling window can call a local procedure of the window that opened it in order to pass it a return value. A return value can also be returned via a global variable.
  • You can specify the return value via the ReturnedValue property of the child window and retrieve this value via the "Close a child window of the window" event of the parent window.
Managing the "Back" and "Home" buttons

Back button

All devices running Android include a special "Back" key (usually a little arrow pointing to the left). In a WINDEV Mobile application, this key closes the current window and runs the "Close" event. 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: It is possible to change this behavior and execute custom processing (e.g. to ask the user for confirmation and possibly not close the window, especially if this is the application's first window).. To do so, the window must have a button with a "'Back' button" shortcut ("UI" tab in the control description window).

Home button

Pressing the "Home" button does not close the current application: the application is put into the background.. The "Close" event is not executed.
Remark: Even if the window has a Button field with the keyboard shortcut "Home Button" (defined in the "UI" tab), the code for this button will not be executed.. 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 their application when they want to move it to the foreground.
Remark: The Android system does not allow this option to be programmed.
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: Non Responsive application
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 the secondary threads (for more details, see ThreadExecute).
Remark: We strongly advise against manipulating application interface elements 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 touch/stylus-controlled UI and keyboard/trackball-controlled UI, Android offers a system for managing focus and selection different from 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 event of the controls are run.
  • The clickable but non-editable controls (buttons, list boxes, etc.) behave like the controls in interruption. They do not gain focus when they receive a click.
  • The "Select a row" event in List Box and Looper controls is run only when the row is selected with a click.
  • The "Select a row" event in List Box and Looper controls is not run when the row (with the focus) changes.
Warning In a List Box control or RepeatString field, the banner displayed does not represent the selection, only the focus.
Automatic scrollbars in the windows
If the size of a window exceeds the size of the screen and if the option "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.
Management of directories
The management of directories in Android presents the following specific features:
  • By default, an application's current directory corresponds to the "files" sub-directory, which is automatically created at the root of the application's installation directory.
  • 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 application installation directory. 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 can only write to its installation directory or one of its subdirectories, as well as to the external memory (SDCard).
  • The "databases" directory is also automatically created at the root of application installation directory to store the SQLite databases handled by the application (unless a specific path was specified during the connection). The path of the "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 a directory for storing files in the external storage space is returned by SysDirExternalStorage.
  • When connecting a device to the PC using the "mass storage" or "disk drive" mode, the SD Card is automatically unmounted from the device and is no longer accessible from it. All running applications installed on the SD Card are killed. While the SD Card is unmounted, you will not be able to:
    • start the applications installed on the SD Card.
    • access the SDCard from the applications run on the phone.
For more details on the management of application directories, see:
Changing the screen orientation
To detect if the screen orientation has changed, use the "Changing the orientation" event in the windows.
You can also use SensorXXXX functions to detect phone movements.
Note: The GPS functions family is used to manage the phone's geolocation..
Miscellaneous
  • In Android, for security reasons, the "Home" and "End of call" keys cannot be used as shortcuts.
  • To use the "Material Design" theme, in the "General" tab of the Android configuration description, check "Apply Material design theme to native controls and to Info/Error/Dialog windows".
  • DPI-dependent image management: Depending on the camera's DPI, images may be pixelated or blurred.. You can use the automatic DPI management. For more details, see Android/iOS: Provide one image per DPI.
  • CSS styles in SVG images are not supported on Android.
Thread management
ThreadStop is not available in Android.
Only the thread can stop itself when exiting 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.
Using native Android fonts
The following fonts can be used:
  • Droid Sans,
  • Droid Sans Mono,
  • Droid Serif,
  • Roboto,
  • Roboto Condensed,
  • Roboto Light,
  • Roboto Thin.
If the device does not support the specified font at runtime, a substitution font will be used (Roboto).
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).
  • Messages of asserts (dbgAssert, dbgCheckxxx, dbgError) ("Assert" level).
  • Messages of fatal and non-fatal errors ("Error" level).
The "ADB log" is accessible:
  • in the Android Control Center ("Logcat" tab): under the "Tools" pane, in the "Mobile tools" group, click on "CCAndroid").
  • 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. For more details, see Preparing the phone to test an Android application).
Printing to PDF
Under Android, PDF printouts support only standard Adobe fonts (not Unicode): Courier, Helvetica, Times, Symbol and ZapFDingbats..
API level
When an application is generated for Android, the resulting APK or AAB contains a target API level (or TargetSdkVersion) of the Android SDK.
This target API level is critical for the deployment and execution of the application.:
  • Google can allow or reject an application on the Play Store depending on its API level,
  • the Android system installed on the devices, determines the functionalities available to the application and the security rules that must be applied to it according to its API level.
It is therefore necessary to generate the application with a version of WINDEV Mobile that is adapted to the Android version on the target devices and to the application deployment mode.
Overview of the API level (TargetSdkVersion) specified in the Android application manifest according to the WINDEV Mobile version:
WINDEV Mobile versionsAPI level (TargetSdkVersion) / Android version supported
WINDEV Mobile 22 -> WINDEV Mobile 23 "Update 2"24 / Android 7
WINDEV Mobile 23 "Update 3" -> WINDEV Mobile 24 "Update 3"26 / Android 8
WINDEV Mobile 24 "Update 4" -> WINDEV Mobile 25 "Update 3"28 / Android 9
WINDEV Mobile 25 "Update 4" -> WINDEV Mobile 26 "Update 2"29 / Android 10
A partir de WINDEV Mobile 26 "Update 3 -> WINDEV Mobile 27 "Update 3"30 / Android 11
WINDEV Mobile 27 "Update 4"31 / Android 12
From WINDEV Mobile 28 -> WINDEV Mobile 28 "Update 1"31 / Android 13
Starting with WINDEV Mobile 28 "Update 2"33 / Android 13
Starting with WINDEV Mobile 2024 "Update 2"34 / Android 14
Minimum version required
  • Version 15
Comments
Click [Add] to post a comment

Last update: 10/17/2024

Send a report | Local help