PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Test of a Windows Mobile application
  • Differences
  • Why differences occur between the simulation of an application and the real execution of the application?
  • The main differences are as follows:
  • What are the features whose behavior differs in test mode and at run time?
  • Differences 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
  • Functions for managing the registry
  • 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 and debug on the development computer: this test simulates a Pocket PC on the development computer. Benefits of this test:
    • Execution speed
    • No connection is required to the Pocket PC
  • Test and debug on the Pocket PC currently connected to the PC.
  • 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 differences occur between the simulation of an application and the real execution of the 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.
These two computers using different environments, the result or the behavior of some features differ on these two computers.
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.
  • Functions for managing the registry:
    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 are the features whose behavior differs in test mode and at run time?

The icon is displayed in the help pages of the WLanguage functions whose behavior differs in simulator mode (GO mode) and at run time.
Differences 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 run time.

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 run time.
  • 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 run time.
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 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) differ in simulation mode and at run time.
  • In simulation mode: The Windows file picker for PC is displayed and it returns a path in PC format (see the previous paragraph).
  • At run time: 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 problem, use InTestMode to find out whether the application is run in test mode or in real 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 run time, 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 run time: The application run must be found on the mobile device.

Functions for managing the registry

If your application is using the registry with the RegistryXXX functions:
  • In simulation mode, these functions will handle the registry of the development computer.
  • At run time, these functions will handle the registry of the mobile device.
To check and run your applications without problem, use InTestMode to find out whether the application is run in test mode or in real mode and call the ceRegistryXXX functions at run time.
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 is using the system functions (SysXXX functions):
  • In simulation mode, these functions will return the characteristics of the development computer. For example, SysWinTitle will return the name of the simulator (instead of the name of the window currently run).
  • At run time, 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 run time, 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 run time, the print is performed on the printer specified on the mobile device.

SMS functions

  • In simulation mode, the SMS functions return a WLanguage error because these functions are available for the Smartphones and for the mobile devices with phone.
  • At run time, the SMSs can be sent from the Smartphones or from the mobile devices with phone.
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 return True.
Minimum required version
  • Version 9
Comments
Click [Add] to post a comment