ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing for Android
  • Overview
  • How to?
  • To generate an application for Android
  • Copying the generated application onto an Android device
  • Implementing a Splash Screen
  • Overview
  • Implementation
  • Operating mode
  • Automatic integration of Java classes
  • Generation options
  • Configuration for the Android generation
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
Overview
The generation of a WINDEV Mobile application for Android groups all project elements (windows, code, etc.) in an archive in order for the application to be deployed on an Android device (physical or emulator) and to be distributed.
For more details on how to create an application for Android, see Developing applications for Android.
How to?

To generate an application for Android

  1. Click Android generation in the quick access buttons. The Android application generation wizard starts.
  2. Select the desired generation mode. This is an important step since the generation format may change depending on the mode selected.
    • "Generate for free deployment (private store, corporate fleet, etc.)": This mode generates an application in Android Package (APK) format.
      Remark: If you use this format to deploy on Google Play Store, a warning message appears during the deployment to indicate that the application can be optimized.
    • "Generate for Google Play Store": This mode generates an application in Android App Bundle (ABB) format, optimized for the store.
  3. The Android SDK and Gradle are required to create the Android executable. You can:
    • Download and install these tools automatically. In this case, WINDEV Mobile downloads and installs all the necessary tools with the desired options. Only an Internet connection is required.
      This method is recommended. Caution: The first download can be quite long.
    • Use the tools automatically installed. This option is available if the tools have been downloaded and installed during a previous generation.
    • Use the tools already installed on your computer. In this case, you just need to specify the installation paths of Gradle and the Android SDK. For more details, see Installing the Android SDK.
    If you are using a proxy to access Internet, click the "Proxy" button to configure or check the Proxy management. For more details, see General options of WINDEV, WEBDEV and WINDEV Mobile.
  4. Go to the next step.
  5. Specify the application name and the package.
    • The application name is the name that will be displayed below the application icon.
      For multilingual applications, this name can be typed in several languages. During the setup, the name of the application will be chosen according to the language settings specified for the device. If the application name is not available in the device language, the name defined for the default language of project will be used.
    • The package is used to identify the application. By convention, it contains the company name (or its Internet domain name in reverse order) followed by the application name. The application name corresponds to the name in the default language of project.
  6. Choose (if necessary) an icon for the application (image in PNG format). This icon is used to make the application more visible in the menu of applications. The default icon will be used if no icon is selected.
    An icon preview is displayed. The arrow button is used to select different icons according to the density of the screen (low density, medium density, high density and very high density).
    Remark: You also have the ability to use the automatic DPI management. For more details, see Android/iOS: Providing an image per DPI.
  7. Specify the email address that will be used by default to send the error report during a fatal error.
    A specific window is displayed when a fatal error occurs in the application:
    The user can:
    • Click the "Error report" link to see the error displayed.
    • Check the box "Send the error report by email". In this case:
      • if the email address was specified, the box will be checked by default and the user will receive the error report in his messaging with the "Sender" and "Recipient" parameters filled.
      • if the email address was not specified, the user will receive the error report in his messaging and it will have to fill the recipient address.
      Remark: To identify the problems encountered by the end user, you also have the ability to use the ADB logs. For more details, see Managing ADB logs.
  8. Go to the next step.
    • Specify whether or not the application should display a launch screen (also called a "splash screen") at startup. The splash screen is used to have the user wait while the "Initialization" event associated with the project is run. For more details, see Characteristics of the splash screen.
    • Enter the general information about the application: the company name, the copyright and the application description.
    • Specify whether the application must be automatically launched when starting the device system.
      Remark: ExeInfo is used to identify the start mode of the Android application.
      Caution: From Android 10 onwards, applications have a different behavior. For more details, see Android 10: Behavior of applications in the background.
    • Specify whether the maximized application windows can be resized (multi-Window). This option is taken into account from Android 7. If this option is enabled, the windows can be displayed in different modes (1/3, 1/2 or 2/3).
  9. Go to the next step.
  10. Specify the version number of generated application. Two formats are available for the version numbers:
    • Standard format. This format is the standard format supported by Windows. This format corresponds to a set of 4 numbers separated by dots.
      • The first group of 4 digits corresponds to the number of major changes performed in the application.
      • The second group of 4 digits corresponds to the number of minor changes performed in the application.
      • The third group of 4 digits corresponds to the generation number.
        We advise you to automatically increment this number at each generation. This increment operation is automatically performed if the option "Automatically increment the version at each generation" is checked.
      • The last group of 4 digits corresponds to the number of reviews (branches in the SCM for example).
    • Format for compatibility. This format was used until version 12 for WINDEV applications.
      Remark: All the characters (digits and letters) are allowed. For example: "1.01A".
      We advise you to:
      • use a different version number whenever the executable program is created. Indeed, when installing an update, this version number is used to check whether the update is mandatory or not.
      • automatically increment the last characters (digit or letter) of the version number each time the executable program is created (check "Automatically increment the version at each generation").
        For example:
        - the version number "1.01A" will become "1.01B".
        - the version number "A15Z" will become "A16A".
  11. Go to the next step.
  12. The application signature is mandatory for a setup on an Android device. It can be done according to three different methods:
    • Using a couple of public/private keys bought toward a trusted authority: this solution is recommended if the application must be distributed in a business way. It guarantees that the application author can be identified.
    • Using a couple of auto-signed public/private keys: this solution can be used if the application is distributed inside a company for example. It avoids going through the trusted authority (whose services are charged for in most cases).
    • Using a generic signature: this solution can be used when developing the application. An application signed with a generic key cannot be published. Its use is limited to tests in "Go" mode on the same development computer.
      Implications of using a generic key to deploy an application: if you change to another development computer, Google Play Store will no longer recognize the generic key when you deploy an application update.
  13. Go to the next step.
  14. If you have chosen to generate the application for a fleet of devices, the wizard proposes to choose the type of devices. You can limit the size of the application by selecting a specific processor architecture.
    Note: If a device is connected to the PC, use the "Detect hardware automatically" option. Thus, next time an application is generated, this device will be automatically selected.
  15. Indicate if there are files to be integrated into the Android application. Selected files are highlighted in blue. You can include:
    • specific resources: images, ...
    • HFSQL data files used by the application, ...
      Integrating files
    By default, the files included in the archive are read-only ("Read" option checked). They can:
    • used in the read-only application directly.
      For example, if an image is included in the read-only Android application, it can be directly assigned to a control by specifying its name. For example:
      IMG_Image = image1
    • be programmatically extracted from the archive (fExtractResource). In this case, the file can be modified later.
    You can specify the destination directory in the APK file (i.e., the destination directory in the archive). The "Automatic" option is selected by default: the file is automatically placed in the right directory according to its type. You can also choose a specific directory.
    Remark: The "Asset" directory is also proposed. If the "Write" option is checked:
    • the file is automatically extracted when the application is started (before the project initialization code is executed).
    • you have the ability to specify an extraction directory. By default, the data files are extracted into the database directory (<DB Directory>)
      Caution: if the files in "Write" mode already exist on the mobile device, they will not be re-extracted.
  16. Go to the next step.
  17. Specify whether libraries must be included in the Android application. You can include:
    • specific Java libraries (*.jar or *.aar files).
    • native libraries (*.so files).
    • the HFSQL library.
      This library is required if your application uses HFSQL data files.
    Remark: ".java" files in the "Other" folder of the "Project explorer" pane are automatically added. For more details, see Automatic integration of Java classes.
  18. Go to the next step.
  19. The wizard prompts you to integrate remote dependencies (e.g., JCenter) into the Android application.
    It is also possible to specify additional repositories (other than JCenter and Google). Go to the next step.
  20. Select the permissions required the application needs to work properly. Each application must indicate to the Android operating system the services to which it must access in order to operate (access to Internet, access to the camera, etc.). WINDEV Mobile automatically adds the necessary permissions according to the statements used in the application.
    Remarks:
    • If you used procedures written in native Java code, you need to add the corresponding permissions.
    • Starting with Android 6, the permission is requested the first time the feature is used (before this version, all permission requests were added during the installation).
  21. Go to the next step.
  22. If your application is available on Google Play, you have the ability to propose your application only for the devices supporting the features used by your application. For example, if your application uses inertial scroll, it will only be proposed for devices that support this feature.
    You can add or remove specific features.
  23. Go to the next step.
  24. Specify the configuration parameters.
  25. If your application uses a Calendar control, a tab or internal window with swipe, you must install the "Android Support Library V4" extension. The Android application cannot be generated if this extension is not installed in the Android SDK. The setup procedure of this extension is available at the following address:
    http://developer.android.com/tools/extras/support-library.html#Downloading
  26. If your application uses a Map control, fill the parameters specific to this type of control. For more details, see Conditions for using the Map control.
  27. If your application uses an Ad control, fill the parameters specific to this type of control. For more details, see Conditions for using the Ad control.
  28. If your application uses Push notifications, you can:
  29. If your application uses In-App purchases, specify the application key. For more details, see Android configuration required for In-App purchases.
  30. If your application uses Facebook authentication:
    • Enter the App ID provided when declaring the application in Facebook.
    • The application generation wizard provides the necessary identifiers to register the Android application on Facebook. For more details, see Using Facebook authentication.
  31. If your application uses full kiosk mode ( "Device Owner" mode), the application generation wizard offers two options:
    • Deployment (required for Google Play Store): An adb command line must be run on the mobile device after the application is deployed. This operation cannot be undone.
    • Testing only (allows uninstalling by command line): This option allows you to deploy the application in Device Owner mode for testing. It will be possible to enable and disable the "Device owner" mode thanks to an adb command line. To use this option, the application must use a generic signature.
      For more details on kiosk mode, see Application in kiosk mode.
  32. The application is compiled and generated in background task. The editor can be used when generating the application.
  33. At the end of generation, the application can be automatically copied and started on the Android device if this one is connected to the development computer or on the emulator. For more details:

Copying the generated application onto an Android device

The generated application is copied onto an Android device:
  • after the generation of the Android application.
  • by expanding the icon for Android generation () in the quick access buttons and by selecting "Deploy the last application generated on the mobile device".
In the window for copying onto a device:
1. Select the device onto which the application will be copied.
  • If it is an emulator and if this one is not started, WINDEV Mobile will automatically start the emulator when validating the window.
  • If it is a physical device, this one must be connected via the USB port and the "USB debugging" option must be enabled on the device. You also have the ability to use a chromebook: the chromebook via adb providing that the chomebook is passed in developer mode.
    For more details, see Preparing the Android phone.
Remarks:
  • Starting an emulator may take several minutes. We advise you to keep the emulator started.
  • This window can also be used to create a new emulator or to delete one if necessary.
  • You have the ability to specify the parameters of command line for starting the emulator.
2. At the end of copy, the application will be automatically started. You will be able to run its test.
Implementing a Splash Screen

Overview

When an Android application is started, the project initialization code is run before opening the first window. The execution time of this code can be quite long and the user may think that the application is slows or that it encounters a problem.
To solve this problem, we recommend that you use a splash screen, displayed while the project initialization code is run.

Implementation

To use a splash screen, select "Splash screen" in the wizard and click on "Options" to define the information displayed:
  • Application name: #APPNAME# is used by default and it corresponds to the application name specified at the beginning of generation wizard. This name can be modified.
  • Version: Corresponds to the version of the application. By default, #VERSION# allows using the version number specified in the generation wizard. This number can be modified.
  • Loading message: This message will be displayed on the splash screen. NextTitle used in the project initialization code allows you to dynamically modify this message.
  • Application logo: This logo will be displayed below the application name.
  • An animation can be displayed while loading the application.
  • Background image: : The background image can be used in portrait and landscape mode. A default image will be used if this image is not specified. If a start image is specified, you have the ability to indicate a specific image according to the resolution of device used.
    Remark: You also have the ability to use the automatic DPI management. For more details, see Android/iOS: Providing an image per DPI.
You can also specify the color to use for the different captions as well as the background color of the splash screen.

Operating mode

The code in the "Initialization" event associated with the project is run in a thread while the splash screen is displayed. It is recommended to run long processes in this event (for example: connection test, connection, extraction of resources etc.).
Automatic integration of Java classes
The Java (".java") source files located in the "Other" folder of the "Project explorer" pane are automatically included when generating the Android application.
The following conditions must be met:
  • Java files must be encoded in UTF-8.
  • If the corresponding Java class belongs to a package, this package must be declared in the first line of the file. If the package is not specified, the file will be located in <Package_AppName>.wdgen with the other generated ".java" files.
Generation options

Configuration for the Android generation

The configuration parameters are as follows:
Android SDK:
The generation uses the Android SDK.
You may have to specify the minimum version required to run the application. WINDEV Mobile 2024 can generate applications compatible with Android version 6.0 (and later).
Remark: If your application uses features not supported by the selected minimum version, a specific icon is displayed to the right of the minimum version. An information message allows you to see the details of features that will not be supported if this minimum version is stored.
Minimum version
Setup location:
The available options are as follows:
  • Internal memory: The application will be installed in the internal memory of the device and it cannot be installed in the external memory (SD card for example). The application will not be installed if the internal memory of device is full.
  • Internal memory movable to the SD card: The application will be installed in the internal memory of device but it can be moved by the user into the external memory from the application for managing the applications (accessible from the menu of device parameters). If the internal memory of device is full during the setup, the application will be installed in the external memory.
  • SD Card movable to the internal memory: The application will be installed in the external memory of device but it can be moved by the user into the internal memory from the application for managing the applications (accessible from the menu of device parameters). If the external memory of device is full or not accessible during the setup, the application will be installed in the internal memory.
Consequences of installing an application in the external memory:
  • Only the APK file of the application is installed in the external memory. The application data (databases, external files, etc.) are still stored in the internal memory, at the same location as if the application was installed in the internal memory (/data/data/<package name>/<application name>).
  • The APK file installed on the external memory is encrypted with a key allowing it to operate with the device that installed it only. Therefore, an application installed on the SD Card operates for a single device.
  • Installing an application on the external memory does not impact the performances of the application.
  • If the user connects his device to the PC in "mass storage" mode (or in "disk drive" mode), the SD Card is automatically dismantled from the device and it is no longer accessible from this one. All running applications installed on the SD Card are killed. The applications installed on the SD Card will not operate as long as the SD Card is dismantled.
Advanced configuration
The options of the advanced configuration are as follows:
  • Customizing the commands
    • Command of Java compiler
    • Signature command
      For more details, see the documentation about the Android SDK.
  • Android SDK: Version used to compile the application. The most recent version installed on the computer is used by default.
  • SHA1 fingerprint of the certificate used to sign the application: To modify this print, all you have to do is modify the certificate used.
  • Customizing the manifest.
    The manifest generated for the Android application can be edited. You have the ability to add, modify, delete nodes or attributes.
    Caution: Modifying the manifest may trigger compilation errors or failures during the execution on the device.
  • Generation options:
    • Don't include the Android Support library: This option is an advanced option, reserved to very special cases.
    • Enable the multidex generation: This option is used to compile huge projects that reach the limit of 65000 methods.
    • Ignore the HTTPS errors: This option is checked by default and it is available for the applications created with a version earlier than WINDEV Mobile 21 and using the HTTP functions or web services. Caution: If you uncheck this option, it will not be redisplayed. To keep the operating mode of application, you will have to use the "HTTTP.IgnoreError = 0" statement in the code. in order to ignore the errors.
  • Deployment options:
    • Obfuscate and reduce the size of generated code: This option is used to:
      • optimize the size of generated code for the Android applications (can be used from Android SDK 4.0). You must install a version of sdk-tool in version 21 or later.
        SDK
      • makes the code generated for the Android applications unreadable in order to protect them from decompilation and reverse-engineering operations.
    • Encrypt the strings: This option is used to encrypt all legible character strings found in the code (useful if identifier or password information is found in the code for example).
Related Examples:
Android Speech Synthesis Android (WINDEV Mobile): Android Speech Synthesis
[ + ] This educational example explains how to manage the recognition and the speech synthesis Android.
The speech synthesis is performed by using either the WLanguage functions, or an external JAR file included in the WINDEV Mobile project.
Minimum version required
  • Version 15
Comments
Click [Add] to post a comment

Last update: 02/07/2024

Send a report | Local help