PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
New WINDEV Mobile 24 feature!
  • This lesson will teach you the following concepts
  • Overview
  • The sample project used
  • Opening project
  • Choosing the platform
  • Activating the iOS platform (optional step)
Lesson 5.1. Overview
This lesson will teach you the following concepts
  • What is a multi-platform project?
  • Which project is used for this part?
  • How to enable a platform?

Estimated time: 10 mn
Previous LessonTable of contentsNext Lesson
Overview
Two separate projects have been created in the previous parts: an iOS project and an Android project.
This new part will allow you to develop an Android and/or iOS application that is using a HFSQL Classic database.

Note

This part can be followed both by the developers of Android applications and by the developers of iOS applications. The operations performed are identical, no matter whether the project is developed for Android only or for iOS only.
We are going to develop a multi-platform project that can be used both on an Android platform and on an iOS platform.
Most of the time, when developing an application for Mobile, this application must operate both on Android and on iOS.
With WINDEV Mobile, there is no need to develop two different projects, to maintain them and to make them evolve in parallel. All you have to do is create a single project associated with several platforms, Android and iOS for example: it is a multi-platform project.
Each project element (windows, queries, ...) can be associated with one or more platforms.
If a window is common to several platforms, the specific features of the platform can be managed via the layouts. The layout is used to define several views of a window in the same project without duplicating this window.
When the project is developed, all you have to do is select the requested configuration to create and deploy the application on the selected platform.
The sample project used
In this lesson, we are going to develop an Android and iOS application that is using a HFSQL Classic database. The creation of projects was already presented in the previous part therefore we will be working on an existing project, containing the database and the data used by the application.

Note

In iOS and Android, only the HFSQL database is accessible in native mode. Both the Classic mode and the Client/Server mode are available.
HFSQL Classic
In HFSQL Classic mode, the data files are stored on the device (iPhone, iPad, Android phones or tablets).
In this case, the application is stand-alone. No Wi-Fi or 4G connection is required.
The data is stored in the device memory. The maximum storage size depends on the amount of memory on the device.
If the data typed on the mobile device must be synchronized with a database found on a server (HFSQL or other), the replication must be implemented (see Replication of mobile data).
In this part, we will develop an application that is using a HFSQL Classic database.

Note

HFSQL Client/Server
In HFSQL Client/Server mode, no data is stored on the device. The data is stored on a computer on which a HFSQL server is installed.
To access this computer and this database, a method for communicating with the server must be enabled in the mobile application (Wi-Fi or 4G) in order to connect via the network or Internet.
The response times depend on the quality of Wi-Fi or Internet network and on the amount of requested data.
The access to the data will be performed by the Hxxx functions of WLanguage and/or by SQL queries.

Opening project

  • Start WINDEV Mobile 24 (if not already done).
  • Display the home page if necessary (Ctrl + <).
  • Open the "WM Managing Products" project.
    To do so, in the home page, click "Tutorial" and select the project named "iOS/Android application (Exercise)".

    Answer

    A corrected project is available. This project contains the different windows created in this lesson. To open the corrected project, in the home page, click "Tutorial" and select "iOS/Android application (with windows)".

Choosing the platform

If you want to develop the application for the Android platform, go to lesson 5.2 - Developing the application.
If you want to follow this part for iOS only, you must add the iOS platform (see next paragraph "Enabling the iOS platform").

Note

All operations performed in this part can be performed on a project associated with an Android platform, on a project associated with an iOS platform or on a multi-platform project.
For information, the different images illustrating the lessons of part 5 have been created with the Android configuration. Slight differences may appear if you are using the iOS configuration.
Activating the iOS platform (optional step)
  • To enable the iOS platform, all you have to do is create a project configuration:
    1. On the "Project" pane, in the "Project configuration" group, expand "New configuration" and select "iPhone/iPad application".

      Note

      The project configurations are used to define the different types of generations supported by the project: Android, iOS, component, ...
      The project elements can be:
      • common to several configurations (a window used in iOS and Android for example).
      • specific to a configuration (a class used by a component for example).
      You can work on a specific configuration at any time: the elements that do not belong to this configuration will be grayed in the project editor.
      See Project configuration for more details.
    2. The wizard for creating a project configuration starts. The wizard proposes to create an iOS platform. Go to the next step.
    3. You can enter information regarding the platform. Keep the default options and go to the next step.
    4. The wizard proposes to choose the type of devices affected by the project:
      • Generate an application for all iPhones and iPads.
      • Generate an application for all iPhones.
      • Generate an application for all iPads.
      • Generate an application for a specific device.

      Note

      If the application is intended to operate on several iOS devices (phones with different sizes or with different resolutions for example), we advise you to use one of the following options: "Generate an application for all iPhones and iPads", "Generate an application for all iPhones" or "Generate an application for all iPads".
      In this case, WINDEV Mobile proposes the smallest resolution to create the application windows. Using anchors (see Lesson 5.2, "Managing anchors in the Product form") will allow the application to operate on all devices.
    5. For this example, select "Generate an application for all iPhones".
    6. Go to the next step and validate the wizard. The iOS configuration is automatically created.
  • The presence of the new project configuration can be checked in the project explorer:
    1. Expand "Configurations (iOS application)" at the top of project explorer.
    2. The two configurations are displayed:
    3. To select a specific configuration, simply double-click the name of the requested configuration.
    4. The iOS configuration that was just created is automatically selected.
Let's now start developing the application.
  • For the rest of this tutorial, we recommend that you activate the Android configuration.
    1. Expand "Configurations (iOS application)" at the top of project explorer.
    2. Double-click on the configuration name "Android application".
    3. The Android configuration is automatically selected.

Note

For information, the different images illustrating the lessons of part 5 have been created with the Android configuration. Slight differences may appear if you are using the iOS configuration (especially in the taskbar).
Previous LessonTable of contentsNext Lesson
Minimum version required
  • Version 24
Comments
Click [Add] to post a comment