|
|
|
|
|
- Deploying an Android application
- Overview
- Generating and distributing the Android application
- Generating the Android application
- Distributing an Android application
- Overview
- Deployment via Google Play
- Deployment via a web server
- Deployment from the PC
- Copying the application to the Mobile device
- Deployment via the Private Store provided with WINDEV Mobile
Tutorial - Deploying a mobile application
Deploying an Android application We will cover the following topics: - Generating the Android application.
- Deploying an Android application
10 min Once the development of the Mobile application is complete, you just need to compile it and install it on the device. You can: - test all the features of the application (maps, etc.).
- deploy the application.
We will see how to deploy the application to an Android device. To follow the steps in this tutorial, we will use the "WM Product Management" project. Opening the example project
- Go to the WINDEV home page (Ctrl + <).
- On the home page, click on "Tutorial", then in the "Tutorial - Deploying an Android application" area, click on the "Open exercise project" link.
Generating and distributing the Android application Generating the Android application To generate the Android application: - If necessary, select the Android platform in the "Project explorer" pane.
- On the "Project" tab, in the "Generation" group, click "Generate" (you can also click in the quick access buttons).
- The Android application generation wizard starts.
- If necessary, select the first window of the application (WIN_Menu, for example) and validate.
- The first step of the wizard is to select the application generation mode. The generation format may change depending on the mode selected.
For this tutorial, select "Generate for free deployment (Private Store, fleet of devices, etc.)". Go to the next step. - The wizard checks for the presence of the tools needed to generate the Android application.
The wizard proposes to:
- Automatically download and install the Android and Gradle SDK In this case, you only need to validate the license. WINDEV Mobile takes care of everything. If an update is available, the generation wizard will prompt you to perform the necessary updates. Only an Internet connection is required.
- Use the tools automatically installed. This option is available if the tools have been downloaded and installed during a previous generation.
- Specify the location of the tools already installed on your computer. In this case, you just need to specify the installation paths of Gradle and the Android SDK.
- Select the option corresponding to your configuration and go to the next step.
Note: If you have chosen to download and install the tools, the next step may take some time, and may require validation of the license. - Go to the next step by clicking the arrows at the bottom of the wizard. The next step of the wizard allows you to:
- define the application name (displayed below the icon used to start the application) and the corresponding package.
- select the application icon in the WINDEV Mobile image catalog ("stock" in the "Flat Soft" theme for example).
- define the email address used by default to send an error report if necessary.
- Go to the next step. This step allows you to define:
- the splash screen of the application,
- the information saved in the manifest,
- the application start mode (start when the device is started).
- Go to the next step. The wizard allows you to define the version number of the application.
- Go to the next step. This step allows you to sign the application. The wizard suggests a generic signature that can be used to test the application. A specific signature is required to distribute the application.
For more details, see Generating an Android application. - Go to the next step. As we have chosen to generate the application for a fleet of devices, the wizard will prompt you to choose the type of devices. Keep the default options.
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. - The next step allows you to include the data files in the application. For our example, pre-filled HFSQL data files are available. They will be provided with the application. In this case, they must be specified in the "Integrate files" step.
- Click the "Add" button.
- Select the data files (.fic, .ndx and .mmo files) in the project's "EXE\Android application" directory. The list of files is displayed.
- Validate.
If your project uses the Android platform only, select the data files in the project's EXE directory.
- Check the "Write" box for each file (required to be able to modify data from the application).
- Go to the next step.
- Validate the other steps until you reach the "Configuration" step that is used to configure the options of Android SDK and the setup location.
- Go to the next step.
- This step is specific to the use of Map controls. It is used to enter the key required to use the Map control. If you own a Google Maps API key, type it. Otherwise, click "Get a key".
- Go to the next step.
- Finish the wizard. The generation is automatically performed in the background. Three small dots (...) appear in the WINDEV Mobile title bar to indicate that the generation is in progress. A popup window is also displayed, indicating the steps of the generation process.
- Once the generation is completed, the popup window allows you to copy and run the application directly on the device connected to the computer or on an emulator ("Deploy").
- A new window appears, allowing you to select the runtime device. If an Android device is connected to the development computer, select this device.
If the device is not connected to the development computer, you must: - Connect the device to the development computer.
- Open the generation directory of the apk file corresponding to the Android application in Explorer: in the "Home" pane, in the "General" group, pull down the option and select "Open generation directory".
- Copy the apk file into the "Download" directory of device.
- Unplug the device.
- Start the application for file management on the device.
- Go to the "Download" directory and run the apk file. The application is automatically installed.
Distributing an Android application Overview WINDEV Mobile allows you to develop Android applications. Once the applications are created, developed and checked, all you have to do is deploy them. Several deployment modes are available: - Deployment via Google Play (or another market).
- Deployment to a web server.
- Deployment from the PC via ADB.
- Deployment by copying the apk file.
- Deployment via the Private Store provided with WINDEV Mobile.
Deployment via Google Play Google Play is an online service used to download applications (free of charge or not) on mobiles devices compatible with Android. Once published, the application can be downloaded by the users all around the world via the Google Play application installed on their phone. The publication of applications on Google Play must comply with specific rules: - To publish an application for the first time, you must create a developer account on Google Play. Once registered, you have the ability to publish or update as many applications as you want as many times as necessary.
- The published application must be signed with a private cryptographic key. You have the ability to sign your own application: using a third-party organism is not mandatory. The validity period of the certificate must end after October 23, 2033.
The applications generated by WINDEV Mobile are automatically signed using the information provided in the generation wizard ("Application signature" step) with a sufficient validity period. Warning The published application must not have been signed using a generic key (to be used only for GO mode tests). - An icon must be associated with the application. The generation wizard of WINDEV Mobile allows you to define the icon to use.
Note Google Play is the best-known application, but others are also available.
Deployment via a web server You can make Android applications available for download via a link on a web page. To do so, you must: - Copy the "apk" file to the web server that hosts the page from which the application will be downloaded.
Remember: the "apk" file is created by WINDEV Mobile when the Android application is generated. - Add a link in the download web page. This link has the following format:
<a href='Path of the apk file on the server'>Link</a> - On the server, add the following MIME type: application/vnd.android.package-archive
The user will only have to display the page with the browser of the phone. The application will be downloaded when the link is clicked. Then, simply click the downloaded file (in the download manager) to install the application. Caution: The "Unknown sources" option must be activated on the phone to enable this installation mode.. To enable this option, refer to your phone's documentation. Deployment from the PC Applications can be deployed from the PC directly via the Android Control Center. Attention USB debugging must be enabled to use the Android Control Center. Otherwise, the phone will not be detected by the Android Control Center. To enable USB debugging: - On the phone, go to "Settings".
- Select "About phone".
- Tap "Build Number" multiple times to enable the developer mode.
- Go back to the previous menu.
- The "Developer Options" entry appears. Select this option.
- Check "USB debugging".
Note: The operations to perform may change according to the version of the phone and to its make. For example, in a Samsung Galaxy phone, you must tap the version number multiple times in the "About phone" option to enable "Developer options". In any case, a Google search with "usb debugging <device name>" allows you to get the operating mode adapted to the device used. To deploy an Android application via the Android Control Center: - Connect the phone to the PC.
- Launch the Android Control Center: under the "Tools" pane, in the "Mobile tools" group, click on "CCAndroid".
- Go to the "Application" tab. This tab lists the applications installed on the device and allows you to install a new application (APK file on the PC).
Copying the application to the Mobile device The easiest way to install an Android application on a mobile device is to copy the apk file to the device and run it. The following operations must be performed: - Connect the device to the PC by USB.
- Copy the apk file of the application to the device (external memory, for example).
Remember: the "apk" file is created by WINDEV Mobile when the Android application is generated. - On the device, use a file explorer to go to the directory where the apk file was copied and click the file to start its setup.
Note Not all devices offer file explorers, but there are many available free of charge. Caution: The "Unknown sources" option must be activated on the phone to enable this installation mode.. To enable this option, refer to your phone's documentation. Deployment via the Private Store provided with WINDEV Mobile With this method, the application can be deployed internally to a fleet of devices. You will be able to manage updates and versions on this fleet of devices. For more details, see Private Store for mobile applications.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|