PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | French EN
  • Overview
  • Test of a Windows Mobile application
  • Differences
  • Why are there differences between the simulation and the actual execution of an application?
  • The main differences are as follows:
  • What features have a different behavior in test mode and at runtime?
  • Differences noticed between a simulation and a real execution
  • Screen of the simulator
  • Functions specifying the file paths
  • File picker (fSelect function)
  • Functions for managing character strings
  • ExeRun and ShellExecute functions
  • Registry management functions
  • Functions for managing the system
  • Functions for managing the keyboard or the memory
  • Print functions
  • SMS functions
  • Notes
  • Functions for handling a CEDB database
  • InWindowsMobileMode function
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview

Test of a Windows Mobile application

WINDEV Mobile proposes several test modes for a Windows Mobile application:
Test modes
  • Test and debug on the development computer (simulator mode): this test simulates a mobile device on the development computer. Benefits of this test:
    • Execution speed
    • Connection to the mobile device not required
  • Test and debug on the mobile device currently connected to the PC.
The debugger can be used in both cases.
Differences

Why are there differences between the simulation and the actual execution of an application?

The simulation of an application and its real execution are performed on two different computers:
  • The PC for the simulation (the test mode)
  • The mobile device (Pocket PC for example) for the real execution.
As these two computers use very different environments, the result or behavior of certain functionalities is different.
These differences are not caused by WINDEV Mobile.

The main differences are as follows:

  • Handling the data found on the current computer.
  • Screen of mobile device
    In test mode, WINDEV proposes a screen closer to the interface for which the application is developed.
    Versions 15 and later
    To allow for a more realistic simulation of the actual runtime environment, you can pivot the display of the simulator into landscape mode. To do so, use Rotation icon on the simulator screen.
    New in version 15
    To allow for a more realistic simulation of the actual runtime environment, you can pivot the display of the simulator into landscape mode. To do so, use Rotation icon on the simulator screen.
    To allow for a more realistic simulation of the actual runtime environment, you can pivot the display of the simulator into landscape mode. To do so, use Rotation icon on the simulator screen.
  • Functions specifying the file paths
    The system for file management differs on mobile devices and on PCs. These two systems do not use the same paths.
  • File picker:
    The file picker for Mobile is more limited.
  • Functions for managing character strings
    The encoding of character strings differs on the PC and on the mobile device (ANSI standard on the PC and UNICODE standard on the mobile device).
  • ExeRun and ShellExecute functions
    The applications to start must be found on the PC in test mode and on the mobile device in real execution.
  • Registry management functions:
    The registry used corresponds to the one of the current system.
  • Functions for managing the system
    The characteristics returned correspond to the characteristics of the current system.
  • Functions for managing the keyboard or the memory
    These functions are specific to the mobile device.
  • Print functions
    The print is specific to the mobile device.
  • The available memory is reduced on the mobile device.
  • Slowed execution on the mobile device.

What features have a different behavior in test mode and at runtime?

The icon can be found in help pages of WLanguage functions that behave differently in simulator mode (GO mode) and at runtime.
Differences noticed between a simulation and a real execution

Screen of the simulator

  • The simulator screen proposes an icon used to display the keyboard of the mobile device . This icon is not enabled in simulation mode.
    This icon can only be used to view the screen of the mobile device in WYSIWYG mode ("What you see is what you get").
  • The buttons found on the simulator allow you to reduce or close the simulation window. These buttons will not be displayed at runtime.

Functions specifying the file paths

The method for managing the directories differs on a PC and on a mobile device (Pocket PC for example).
Indeed, on a PC, the paths have the following format: "C:\MyDocuments\MyFile.txt".
On the contrary, on a mobile device, the paths have the following format: "\MyDocuments\MyFile.txt". There are several tree structures and the notion of drive does not exist.
Summary
The paths such as "\MyDocuments\MyFile.txt":
  • are valid at runtime.
  • use the current disk in test mode.
The paths such as "C:\MyDocuments\MyFile.txt":
  • are valid in test mode.
  • trigger a WLanguage error at runtime.
Reminder: The files and directories used in test mode are the ones found on the development computer and not the ones found on the mobile device.
To test and run your applications without problem, one of the following two solutions can be implemented:
  • Solution 1: All the files used are found in the directory of the application. Use fExeDir to build the path of the files to use.
  • Solution 2: Use a different prefix for the path of the files depending on whether the application is run in test mode or in real mode (InTestMode).
Example:
IF InTestMode() = True THEN
        FilePrefix = "C:\"
ELSE
        FilePrefix = "\"
END

File picker (fSelect function)

The operating mode and the result of the file picker (fSelect) are different in simulation mode and at runtime.
  • In simulation mode: The Windows file picker for PC is displayed and it returns a path in PC format (see the previous paragraph).
  • At runtime: The file picker specific to the mobile device is displayed and it returns a path in the format of the mobile device.
To test and run your applications without problems, use InTestMode to find out if the application is actually run or if it is in test mode.
Example:
IF InTestMode() = True THEN
// Select a file in C:\Directories
File = fSelect("C:\Directories", "File.txt", ...
"Select a file", ...
"Text file (*.TXT)" + TAB + "*.txt" + CR + "All" + TAB + "*.*", "txt")
ELSE
// Select a file in "\MyDocuments\Directories"
File = fSelect("\Directories", "File.txt", ...
"Select a file", ...
"Text file (*.TXT)" + TAB + "*.txt" + CR + "All" + TAB + "*.*", "txt")
END

Functions for managing character strings

The method for managing the character strings differs between the system of the development computer (character strings in ANSI format) and the system of mobile devices (character strings in UNICODE format).
  • In simulation mode, the functions for handling strings will return a result in ANSI format (format of character strings on the development computer).
  • At runtime, the functions for handling strings will return a result in UNICODE format (format of character strings on the mobile device).
The main functions that may return a different result are as follows: Asc, Right, Left, Middle, Size.
Important: WINDEV Mobile automatically manages the ANSI or UNICODE format according to the runtime platform of the application. No specific code is required.

ExeRun and ShellExecute functions

ExeRun and ShellExecute run a specific application.
  • In simulation mode: The application run must be found on the development computer.
  • At runtime: The application run must be found on the mobile device.

Registry management functions

If your application handles the registry with the RegistryXXX functions:
  • In simulation mode, these functions will handle the registry of the development computer.
  • At runtime, these functions will handle the registry of the mobile device.
To test and run your applications without problems, use InTestMode to find out if the application is actually run or if it is in test mode, and use ceRegistryXXX functions at runtime.
Example:
IF InTestMode() = True THEN
// Create the "HKEY_LOCAL_MACHINE\SOFTWARE\MyApp" key
ResCreateKey = RegistryCreateKey("HKEY_LOCAL_MACHINE\SOFTWARE\MyApp")
ELSE
// Create the "HKEY_LOCAL_MACHINE\SOFTWARE\MyApp" key
ResCreateKey = ceRegistryCreateKey("HKEY_LOCAL_MACHINE\SYSTEM\SOFTWARE\MyApp")
END

Functions for managing the system

If your application uses system functions (SysXXX functions):
  • In simulation mode, these functions will return the characteristics of the development computer. Thus, SysWinTitle will return the name of the simulator, instead of the name of the window being run.
  • At runtime, these functions will return the characteristics of the mobile device.

Functions for managing the keyboard or the memory

  • In simulation mode, the functions for keyboard management (SIPXXX functions) and the functions for memory management (SIMXXX functions) return a WLanguage error.
  • At runtime, these functions are used to handle the keyboard and the memory of the mobile device.

Print functions

  • In simulation mode:
    • iDestination returns a WLanguage error.
    • iConfigure and iParameter open the window for printer selection (a printer is selected on the development computer and not on the mobile device).
  • At runtime, the print is performed on the printer specified on the mobile device.

SMS functions

  • In simulation mode, SMS functions return a WLanguage error because these functions are only available for Smartphones and mobile devices with phone capabilities.
  • At runtime, SMSs can be sent from the Smartphones or mobile devices with phone capabilities.
Notes

Functions for handling a CEDB database

Your application accesses a database of the mobile device (cdbxxx functions). The test mode operates as follows:
  • If a mobile device is connected to the development computer, the functions for handling a CEDB database will handle the database of the connected mobile device.
  • A WLanguage error occurs if no mobile device is connected to the current computer during the simulation.

InWindowsMobileMode function

During a test in simulator mode, InWindowsMobileMode always returns True
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment