- 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
Generating an Android application
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. To generate an application for Android - Click
in the quick access buttons. The Android application generation wizard opens. - 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 generation mode generates an application in Android Package (APK) format..
Note: If you use this format to deploy to the Google Play Store, a warning message will be displayed during deployment indicating that the application may need to be optimized. - "Generate for Google Play Store": This generation mode generates an application in Android App Bundle (AAB) format, optimized for the Google Play Store..
- 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 take 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 WINDEV, WEBDEV and WINDEV Mobile general options. - Go to the next step.
- 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 used will be the name defined for the project's default language.. - 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 used corresponds to the name in the project's default language.
- 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: It is also possible to use automatic IPR management.. For more details, see Android/iOS: Provide one image per DPI. - 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.
Note: ADB logs can also be used to identify problems encountered by end-users. For more details, see Managing ADB logs.
- 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 general information about the application: company name, copyright and application description.
- Specify whether the application must be automatically launched when starting the device system.
Note: Use the ExeInfo function to find out how the Android application is launched.. Warning: Starting with Android 10, application behavior changes. 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).
- Go to the next step.
- 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.
Note: All characters (numbers 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".
- Go to the next step.
- The application signature is mandatory for a setup on an Android device. It can be done according to three different methods:
- Use of a public/private key pair purchased from a trusted authority: this solution is preferred if the application is to be distributed commercially. It guarantees that the application author can be identified.
- Use of a self-signed public/private key pair: this solution can be used if the application is distributed internally within a company, for example.. It avoids going through the trusted authority (whose services are charged for in most cases).
- Use of a generic signature: this solution can be used during application development. An application signed with a generic key cannot be published. Its use is limited to tests in "Go" mode on the same development computer.
One of the effects of using a generic key during deployment: if you change your development workstation, this generic key will no longer be recognized by Google Play Store when you deploy an application update.
- Go to the next step.
- 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 "Detect hardware automatically". Thus, next time an application is generated, this device will be automatically selected. - Indicate if there are files to be integrated into the Android application. Selected files are highlighted in blue. You can include:
- specific resources such as images, etc.
- HFSQL data files used by the application.
By default, the files included in the archive are read-only ("Read" option checked). They can be: - 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:
- 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. This means that the file is automatically placed in the right directory according to its type. You can also choose a specific directory. Note: The "Asset" directory is also available. 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.
- Go to the next step.
- 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. Note: ".java" files in the "Others" folder of the "Project Explorer" pane are automatically added.. For more details, see Automatic integration of Java classes. - Go to the next step.
- 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. - Select the permissions required the application needs to work properly. Each application must tell the Android operating system which services it needs to access in order to function (Internet access, camera access, 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).
- Go to the next step.
- If your application is available on Google Play, it is possible to offer your application only for devices that support the functionalities used by your application.. For example, if your application uses inertial scroll, it may be proposed only for hardware that supports this feature..
You can add or remove specific features. - Go to the next step.
- Specify the configuration parameters.
- 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 - 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.
- 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.
- If your application uses Push notifications, you can:
- If your application uses In-App purchases, specify the application key. For more details, see Android configuration required for In-App purchases.
- 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.
- If your application uses full kiosk mode ( "Device Owner" mode), the application generation wizard offers two options:
- Deployment (required for Google Play Store): After application deployment, an adb command line must be executed on the mobile device.. This operation cannot be undone.
- Testing only (allows uninstalling by command line) This option lets you 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.
- The application is compiled and generated in background task. The editor can be used when generating the application.
- 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. It's also possible to use a Chromebook: the Chromebook via adb, provided the Chromebook has been switched to 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: By default, #APPNAME# is used and corresponds to the application name specified at the start of the generation wizard.. This name can be modified.
- Version: Corresponds to the application version. 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 under the application name..
- An animation can be displayed while loading the application.
- Background image: : Background image can be used in both portrait and landscape modes. 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.
Note: It is also possible to use automatic IPR management.. For more details, see Android/iOS: Provide one 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 advisable to perform long processing operations in this event (e.g. connection test, connection, resource extraction, 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, the declaration of this package must be 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.
Configuration for the Android generation The configuration parameters are as follows: SDK Android: The generation uses the Android SDK. You may have to specify the minimum version required to run the application. WINDEV Mobile 2025 can generate applications compatible with Android versions 7.0 and higher.Attention Starting with version 2025 Update 1, the minimum version required has been modified and now corresponds to Android 7.0. In previous versions, this minimum version corresponded to Android 6.0. Note: If your application uses features not supported by the selected minimal version, a specific icon appears to the right of the minimal version.. An information message allows you to see the details of features that will not be supported if this minimum version is stored. Installation location: The possible options are as follows: - Internal memory: The application will be installed in the device's internal memory and cannot be installed in external memory (SD card, for example).. The application will not be installed if the internal memory of device is full.
- Internal memory / moveable to SD card: The application will be installed in the device's internal memory, but can be moved by the user to external memory via the application management application (accessible from the device settings menu).. If the internal memory of device is full during the setup, the application will be installed in the external memory.
- SD Card / moveable to internal memory: The application will be installed in the device's external memory and can be moved by the user to internal memory via the application management application (accessible from the device settings menu).. 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 performance 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. As long as the SD Card is unmounted, it will not be possible to launch applications installed on the SD Card.
Advanced configurationThe options of the advanced configuration are as follows: - Customizing the commands
- Java compiler command
- Signature command
For more details, see the documentation about the Android SDK.
- SDK Android: 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 fingerprint, simply 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 cause compilation errors or runtime malfunctions on the device. - Generation options:
- Do not integrate Android Support library This is an advanced option, reserved for very special cases.
- Enable multidex generation: This option lets you compile large projects reaching the 65,000 method limit.
- Ignore HTTPS errors: This option is checked by default and is only available for applications created with a version lower than WINDEV Mobile 21 and using HTTP functions or web services.. Caution: If you uncheck this option, it will no longer 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 allows you 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.
- makes the code generated for the Android applications unreadable in order to protect them from decompilation and reverse-engineering operations.
- Encrypt strings: This option encrypts all readable strings in the code (useful, for example, if the code contains login or password information)..
Related Examples:
|
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.
|
|
|
|