Concepts - Source : www.pcsoft-windev-webdev.com
Concepts - Source : www.pcsoft-windev-webdev.com
Concepts - Source : www.pcsoft-windev-webdev.com
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Concepts</strong>
WinDev Mobile 12 - <strong>Concepts</strong><br />
Version 12 - (1) 0208<br />
Remember to visit the PC SOFT site (<strong>www</strong>.<strong>windev</strong>.<strong>com</strong>) on a regular basis to find out whether upgraded<br />
versions are available.<br />
Email address of Free Technical Support: freetechnicalsupport@<strong>windev</strong>.<strong>com</strong>.<br />
This documentation is not contractually binding. PC Soft reserves the right to modify or delete any topic<br />
dealt with in this document.<br />
All product names or other trademarks mentioned in this publication are registered trademarks of their respective owners.<br />
© PC SOFT 2008: This publication may not be reproduced in part or in while in any form without the express permission of PC SOFT.
3WinDev Mobile <strong>Concepts</strong><br />
SUMMARY<br />
PART 1 - DEVELOPING AN APPLICATION<br />
Development environment ..................................................................................................................... 8<br />
Developing an application for Pocket PC .............................................................................................. 9<br />
Project and Analysis .............................................................................................................................. 10<br />
Dashboard of the project ..................................................................................................................... 11<br />
Custom-folders: Organize your project ................................................................................................ 12<br />
WinDev, WebDev, WinDev mobile: same project ............................................................................... 13<br />
Project configuration ............................................................................................................................ 14<br />
Multiple generation ............................................................................................................................... 15<br />
WinDev Mobile and Windows ............................................................................................................... 16<br />
WinDev Mobile and the processors ..................................................................................................... 17<br />
The different types of windows ............................................................................................................ 18<br />
The controls available in a window ...................................................................................................... 19<br />
The menus ............................................................................................................................................. 20<br />
Window template .................................................................................................................................. 21<br />
Control templates ................................................................................................................................. 22<br />
RAD ........................................................................................................................................................ 23<br />
RID ......................................................................................................................................................... 24<br />
Component ............................................................................................................................................ 25<br />
Multi-product <strong>com</strong>ponents ................................................................................................................... 26<br />
The reports ............................................................................................................................................ 27<br />
<strong>Source</strong> Code Manager (SCM) ............................................................................................................... 28<br />
Project Monitoring Center .................................................................................................................... 30<br />
ActiveSync ............................................................................................................................................. 31<br />
Running the test of a WinDev Mobile application .............................................................................. 32<br />
Unit tests ............................................................................................................................................... 33<br />
Unit tests on the executable ................................................................................................................ 34<br />
Installing an application for Pocket PC ............................................................................................... 35<br />
PART 2 - DATABASE<br />
Data handled by an application for Pocket PC ...................................................................................40<br />
Hyper File Mobile database ................................................................................................................. 41<br />
Hyper File Client/Server database ...................................................................................................... 42<br />
Standard CEDB database .................................................................................................................... 43<br />
Handling custom CEDB databases ...................................................................................................... 45<br />
Handling the CEDB databases in WLanguage .................................................................................... 48<br />
Comparing Hyper File Mobile and CEDB ............................................................................................. 49<br />
The queries ............................................................................................................................................ 51<br />
The embedded queries ......................................................................................................................... 52<br />
Synchronizing the data ......................................................................................................................... 53<br />
3-tier ....................................................................................................................................................... 55
4<br />
PART 3 - PROGRAMMING IN WLANGUAGE<br />
WLanguage functions ...........................................................................................................................58<br />
Handling character strings ...................................................................................................................59<br />
File picker and paths on Pocket PC .....................................................................................................61<br />
Managing the keyboard ........................................................................................................................62<br />
Functions specific to Pocket PC ...........................................................................................................63<br />
PART 4 - COMMUNICATION<br />
Communication with WinDev Mobile ...................................................................................................66<br />
Managing emails (POP3/SMTP protocol) ............................................................................................69<br />
Managing emails (CEMAPI) ...................................................................................................................70<br />
Handling files on an FTP server ............................................................................................................72<br />
Managing SMSs .....................................................................................................................................73<br />
PART 5 - INTERACTIONS BETWEEN WINDEV - WINDEV MOBILE<br />
Interaction with a standard WinDev application .................................................................................76<br />
Pocket PC: Sharing WinDev elements .................................................................................................77<br />
Handling a Pocket PC from a standard WinDev application ..............................................................78<br />
PART 6 - APPENDICES<br />
New features in WinDev Mobile 12 .....................................................................................................82<br />
Tools available for WinDev Mobile .......................................................................................................84<br />
Components supplied with WinDev Mobile .........................................................................................85<br />
Examples supplied with WinDev Mobile ..............................................................................................86<br />
WinDev Mobile <strong>Concepts</strong>
5WinDev Mobile <strong>Concepts</strong><br />
IN WHICH ORDER SHOULD THESE GUIDES<br />
BE READ?<br />
WinDev Mobile is a powerful tool used to develop applications for Pocket PCs (Smartphone, Psion,<br />
and so on).<br />
To quickly and efficiently learn how to use WinDev Mobile, we advise you to work in the<br />
following order:<br />
1<br />
2<br />
3<br />
Read the "<strong>Concepts</strong>".<br />
This guide presents the main concepts required to create a WinDev Mobile application.<br />
"Tutorial" (book + exercises)<br />
The Tutorial provides a first "hands-on" approach to WinDev Mobile. It enables you<br />
to familiarize yourself with the main editors of WinDev Mobile.<br />
Test the examples<br />
Test the examples supplied with WinDev Mobile in the fields you are interested in<br />
(SMS, poll, and so on).<br />
The online help enables you to easily find out the syntax of a WLanguage function, to display help<br />
pages for the interface, to discover the programming concepts associated with a feature, and so on.<br />
We hope you enjoy getting started with WinDev Mobile.
6<br />
WinDev Mobile <strong>Concepts</strong>
PART 1<br />
Developing an application
8<br />
Part 1: Development of an application
9<br />
DEVELOPMENT ENVIRONMENT<br />
WinDev Mobile is a development environment for PC that allows you to develop applications for<br />
Pocket PC, Smartphone, and so on.<br />
Windows PC<br />
Installing<br />
WinDev Mobile<br />
Pocket PC<br />
Developing the<br />
application<br />
GO<br />
Running the<br />
application<br />
test<br />
Creating the<br />
executable<br />
Note: The applications generated by WinDev Mobile operate on one of the following platforms<br />
(equipped with the ARM processor, the ARM v4T processor or the x86 processor):<br />
• Pocket PC (2002, 2003, and so on)<br />
• Windows Mobile phone (Smartphone, and so on)<br />
• Windows CE 3, 4 and 5 (Psion, and so on)<br />
These applications do not operate on Windows PCs.<br />
Connection: USB, Wi-Fi, Bluetooth...<br />
SETUP or<br />
direct COPY<br />
Using the<br />
WinDev Mobile<br />
application<br />
Note: In this book, "Pocket PC" represents all the available runtime platforms (Pocket PC,<br />
Smartphone, Psion, and so on). For special cases, the name of the relevant platform is specifically<br />
mentioned.<br />
Part 1: Developing an application
10<br />
DEVELOPING AN APPLICATION FOR<br />
POCKET PC<br />
Specifications<br />
Creating the project<br />
Importing existing files<br />
Creating the analysis<br />
Development<br />
Part 1: Developing an application<br />
- Project RAD<br />
- Window RAD<br />
- Queries<br />
- Report<br />
- <strong>Source</strong> code<br />
GO<br />
Library<br />
(*.WDL)<br />
Running the<br />
application test<br />
Creating the executable<br />
Preparing for<br />
setup<br />
Executable<br />
(*.EXE)<br />
Setup
11<br />
PROJECT AND ANALYSIS<br />
A WinDev Mobile project is a set of windows, controls, classes, <strong>com</strong>ponents, ... whose purpose is to<br />
create a Windows application.<br />
A WinDev Mobile analysis groups the description of the data files.<br />
In most cases, a project is associated with an analysis.<br />
An analysis can be associated with one or more projects.<br />
Project 2<br />
Classes<br />
Windows and<br />
controls<br />
Style sheet<br />
Analysis<br />
Project 1<br />
Project N<br />
Classes<br />
Style<br />
sheet<br />
Windows and<br />
controls<br />
Classes<br />
Style<br />
sheet<br />
To create the "lovelyeyes" application, create the "lovelyeyes" project.<br />
Windows and<br />
controls<br />
Part 1: Developing an application
12<br />
DASHBOARD OF THE PROJECT<br />
The project dashboard is a main element for managing the WinDev Mobile projects. The project<br />
dashboard gives an overall view of the progress status of a project.<br />
The project dashboard is made of:<br />
- lights: Everything is OK when the lights are green. The red lights indicate a possible problem.<br />
- lists of elements, giving quick access to the main options of the project.<br />
- counters, used to manage new features and requests, and so on.<br />
Part 1: Developing an application
13<br />
CUSTOM-FOLDERS: ORGANIZE YOUR<br />
PROJECT<br />
The project editor of WinDev Mobile is used to represent the diagram of the project.<br />
With large projects, this representation may be difficult to read. The "custom-folders" are used to<br />
improve this representation<br />
A "custom-folder" contains the elements stored by yourself, for instance: the application elements<br />
that can be used in Pocket PC and those that can be used in Smartphone.<br />
Some elements can be <strong>com</strong>mon to several "custom-folders".<br />
It makes it easier to work on part of the application.<br />
Windows, reports, queries<br />
relating to Pocket PCs<br />
Content of<br />
custom-folder<br />
Pocket PC<br />
Content of<br />
custom-folder<br />
Smartphone<br />
Windows, reports, queries<br />
relating to Smartphones<br />
Part 1: Developing an application
14<br />
WINDEV, WEBDEV, WINDEV MOBILE:<br />
SAME PROJECT<br />
The projects are often multi-target projects.<br />
For instance, for an ERP system intended for Windows, it is very likely that beside the main<br />
application, that will be the backbone of the solution, there will be sales people equipped<br />
with PDAs or Smartphones, shops that will use mobile terminals to manage inventory and<br />
that Intranet and Internet sites will be implemented.<br />
Now, this information is grouped in a global project.<br />
Regardless of the product where the project was created, it can be opened by the other<br />
products.<br />
When a project is opened in a product other than<br />
the one where it was created, a wizard is displayed,<br />
allowing you to create a project configuration specific<br />
to the product used.<br />
Part 1: Developing an application<br />
For instance, if a WinDev project is opened by Web-<br />
Dev, you will have the ability to create a project configuration<br />
named "WEBSite" used to group all the<br />
elements required by the WebDev site.<br />
In each phase of the environment, you can now view<br />
the elements of each target. A project in WinDev displays<br />
the thumbnails of the WebDev pages and the<br />
WinDev Mobile windows for instance.<br />
Clicking a WebDev page from the project editor of<br />
WinDev opens the WebDev page (WebDev must be<br />
installed on the <strong>com</strong>puter).<br />
The following elements are also shared: the<br />
documents, the modeling descriptions, the<br />
<strong>com</strong>ponents, the classes, and so on.
15<br />
PROJECT CONFIGURATION<br />
The project configurations are used to create several different "targets" from the same project.<br />
For instance, from the same project, you can create:<br />
- 2 or 3 executables that do not contain the same elements, with different names, and so on.<br />
- 3 or 4 <strong>com</strong>ponents<br />
- and so on.<br />
You can work on a specific configuration at any time: the elements that do not belong to this<br />
configuration are grayed in the project graph.<br />
Mobile project<br />
WinDev Mobile<br />
executable<br />
Project configurations<br />
Config 1 Config 2 Config 3<br />
Library<br />
…<br />
Component<br />
The multiple generation allows you to generate all the project configurations (or some of them) in a<br />
single operation.<br />
Part 1: Developing an application
16<br />
MULTIPLE GENERATION<br />
The project configurations are used to easily define the different "targets" of your project. Several<br />
executables, several <strong>com</strong>ponents and several libraries can be defined for the same project.<br />
To generate the result of each configuration, you can select each configuration one by one and<br />
generate the corresponding program.<br />
Another faster method is available: the multiple generation. In a single operation, you select the<br />
configurations to generate, and the result is immediate.<br />
Part 1: Developing an application<br />
To start a multiple generation, select "Workshop .. Multiple generation".
17<br />
WINDEV MOBILE AND WINDOWS<br />
The applications developed with WinDev Mobile can operate with the following versions of<br />
Windows:<br />
• Windows Pocket PC 2002.<br />
• Windows Mobile 2003 / 2003 SE (VGA) for Pocket PC and for Smartphone.<br />
• Windows Mobile 5.0 for Pocket PC and for Smartphone.<br />
The diagram below presents the different Windows families available for Pocket PCs.<br />
Part 1: Developing an application
18<br />
WINDEV MOBILE AND THE PROCESSORS<br />
The applications developed with WinDev Mobile can operate on the Pocket PCs equipped with the<br />
following processors:<br />
• ARM and <strong>com</strong>patible (Strong ARM, XScale, Samsung, Texas Instrument, and so on)<br />
• ARM v4T and <strong>com</strong>patible (XScale, and so on)<br />
• x86 and <strong>com</strong>patible (AMD Geode, Transmeta Crusoe, VIA C3, C7, Eden, and so on)<br />
Part 1: Developing an application
19<br />
THE DIFFERENT TYPES OF WINDOWS<br />
Two types of windows can be used by the WinDev Mobile applications:<br />
• The maximized windows (most often used). A maximized window takes up the entire screen<br />
on a Pocket PC.<br />
• The non-maximized windows. A non-maximized window can be resized by the user and it can<br />
take up part of the screen only.<br />
The maximized windows<br />
The main elements of a maximized window are as follows:<br />
The non-maximized windows<br />
The main elements of a non-maximized window are as follows:<br />
"OK/Close" button<br />
"OK/Close" button is used to validate the current window or to close this window. This button is<br />
associated with a specific process of the window ("Before closing via the OK/Close button") run<br />
before the closing code of the window.<br />
Part 1: Developing an application
20<br />
THE CONTROLS AVAILABLE IN A WINDOW<br />
Several controls are available in WinDev Mobile:<br />
You want to…<br />
Use a control of the<br />
following type<br />
Part 1: Developing an application<br />
Display text, a title, and so on.<br />
Display a price, a quantity, an address, a date, a time, and<br />
so on.<br />
Select a value from a list (country, city, currency, and so on)<br />
Select several values from a list<br />
Display a graphic image (photo, statistics, chart, and so on)<br />
Display an animation (animated Gif)<br />
Display the content of a file in a table (list of customers, order<br />
details, and so on)<br />
Repeat controls in a window (product catalog with photo,<br />
and so on)<br />
Display a bar chart, a line chart, a pie chart<br />
Enter information<br />
Display the progress of an operation<br />
Program an action in a window (display another window,<br />
start a printout, and so on)<br />
Group the controls by theme and display the themes one by<br />
one<br />
Static control<br />
Edit control<br />
Radio button, Combo box, List<br />
box, ListView<br />
Check box, List box<br />
Image<br />
Image<br />
Browsing table or memory table<br />
Looper<br />
Chart control<br />
Edit control<br />
Progress Bar control<br />
Button<br />
Tab, sidebar
21<br />
THE MENUS<br />
the menus created by WinDev Mobile automatically adapt to the runtime platform.<br />
Pocket PC<br />
The menus are displayed at the bottom of<br />
the window.<br />
Smartphone<br />
The menus are displayed at the bottom<br />
of the window.<br />
The menu options can be easily selected<br />
with the stylus of Pocket PC.<br />
The menu options are automatically<br />
numbered: numbers are automatically<br />
added in front of the caption of each<br />
sub-option. These numbers are used to<br />
access the sub-options by pressing the<br />
Smartphone keys.<br />
The menu options can also be accessed<br />
via the "joystick" of Smartphone.<br />
Note: Only two menus can be displayed<br />
simultaneously in an application for<br />
Smartphone. These menus can be<br />
accessed via the buttons found below<br />
the Smartphone screen.<br />
Part 1: Developing an application
22<br />
WINDOW TEMPLATE<br />
WinDev Mobile enables you to create window templates. These templates contain all the graphic<br />
elements <strong>com</strong>mon to all the windows of your application.<br />
The modifications made to a window template are automatically applied to all the windows that use<br />
this template.<br />
A window template enables you to <strong>com</strong>ply with the style book defined for an application.<br />
Defining a window template.<br />
The template is enclosed by a<br />
green line in the editor.<br />
Part 1: Developing an application<br />
Using the template in several windows.<br />
The elements belonging to the template are identified by a yellow square.<br />
A window template can be created:<br />
- directly ("File .. New .. Window template").<br />
- from the current window ("File .. Save as template").<br />
To create a window based on a template, select the template that will be used when creating the<br />
window.<br />
Note: The template elements can be programmed in the template itself.<br />
The characteristics of the elements can be dissociated from the template. For example, the position<br />
of a control can be dissociated from the template so that the control can be located somewhere<br />
else while it still benefits from the other features (code, style, and so on). We talk of control<br />
inheritance. In this case, the elements are identified by a blue square.
23<br />
CONTROL TEMPLATES<br />
WinDev Mobile enables you to create control templates. A control template is a set of controls that<br />
can be reused in several windows.<br />
The modifications made to a control template are automatically applied to all the windows that use<br />
this template.<br />
A control template is used to:<br />
- group a set a controls for a specific purpose.<br />
- make the controls independent of the window hosting them.<br />
Defining a control template.<br />
The template is enclosed by a green line in the editor.<br />
Using the template in a window.<br />
The elements belonging to the template are enclosed<br />
by a blue line and identified by a yellow square.<br />
A control template can be created:<br />
- directly ("File .. New .. Control template")<br />
- from the controls found in the window ("Control .. Refactoring .. Create a control template from<br />
the selection").<br />
To create a window based on a control template, create a "Control Template" control.<br />
Note: The template elements can be programmed in the template itself.<br />
The characteristics of the elements can be dissociated from the template. For example, the position<br />
of a control can be dissociated from the template so that the control can be located somewhere<br />
else while it still benefits from the other features (code, style, and so on). We talk of control<br />
inheritance. In this case, the elements are identified by a blue square.<br />
Part 1: Developing an application
24<br />
RAD<br />
RAD (Rapid Application Development) is used to create windows from:<br />
• the analysis linked to the project,<br />
• standard RAD patterns,<br />
•custom RAD patterns,<br />
•skin templates.<br />
The generated windows contain the necessary source code. The test of these windows can be<br />
immediately run with the data found on the development <strong>com</strong>puter.<br />
Analysis<br />
RAD pattern<br />
Custom RAD pattern<br />
Skin template<br />
Part 1: Developing an application<br />
RAD<br />
Full application RAD<br />
Window RAD<br />
Example of window<br />
generated by RAD<br />
Example of code<br />
generated by RAD
25<br />
RID<br />
RID (Rapid graphical Interface Design) is used to create windows from:<br />
• the analysis linked to the project,<br />
•standard RAD patterns,<br />
•custom RAD patterns,<br />
•skin templates.<br />
The generated windows only contain the controls linked to the analysis items. The source code<br />
required for these windows to operate must be written by the developer. Your custom code can be<br />
entered directly.<br />
Analysis<br />
RAD pattern<br />
Custom RAD pattern<br />
Skin template<br />
RID<br />
Window RID<br />
Part 1: Developing an application<br />
Example of window generated by RID<br />
This window contains no source code
26<br />
COMPONENT<br />
A <strong>com</strong>ponent is a set of WinDev Mobile elements: windows, reports, analysis, and so on. This set of<br />
elements performs a specific feature. For example, a <strong>com</strong>ponent can correspond to one of the<br />
following features:<br />
• Send an SMS,<br />
• Send emails,<br />
• and so on.<br />
A WinDev Mobile <strong>com</strong>ponent can be distributed to other WinDev Mobile developers (free of charge<br />
or not). These developers will be able to easily include the feature proposed by the <strong>com</strong>ponent in<br />
their application. The <strong>com</strong>ponent will be included in the application and distributed along with it.<br />
WinDev Mobile<br />
project<br />
Developing the<br />
<strong>com</strong>ponent<br />
Generating the <strong>com</strong>ponent<br />
Part 1: Developing an application<br />
WinDev<br />
Mobile project<br />
Using the<br />
<strong>com</strong>ponent<br />
.WDK file<br />
Importing the <strong>com</strong>ponent<br />
into different WinDev<br />
Mobile projects<br />
WinDev Mobile<br />
project<br />
Using the<br />
<strong>com</strong>ponent<br />
WinDev<br />
Mobile project<br />
Using the<br />
<strong>com</strong>ponent
27<br />
MULTI-PRODUCT COMPONENTS<br />
WinDev, WebDev and WinDev Mobile give you the ability to create multi-product <strong>com</strong>ponents. These<br />
<strong>com</strong>ponents can contain windows, pages, ... and they can be used in a WinDev, WebDev or WinDev<br />
Mobile project.<br />
The principle is as follows:<br />
Unique project<br />
Projet <strong>com</strong>mon to WinDev, WebDev, WinDev Mobile<br />
HTML pages to include in the <strong>com</strong>ponent<br />
Window to include in the <strong>com</strong>ponent<br />
Creating the <strong>com</strong>ponent<br />
- Selecting the elements<br />
- Choosing the target products<br />
(WinDev, WebDev, and so on)<br />
WDK and WDI files<br />
Usable in the projects of the selected<br />
target products<br />
Part 1: Developing an application
28<br />
THE REPORTS<br />
WinDev Mobile enables you to easily create and print all types of reports with the report editor.<br />
The generated reports can be printed in PCL format (".PCL" file or print on a PCL printer).<br />
Report <strong>Source</strong>s<br />
Table Controls<br />
Print<br />
(PCL format)<br />
Queries<br />
Report<br />
Part 1: Developing an application<br />
Data Files<br />
Txt<br />
Text files<br />
PCL file<br />
Other print modes<br />
WinDev Mobile also enables you to pint in WLanguage (iXXX functions).<br />
You also have the ability to directly send sequences of <strong>com</strong>mands to a printer (if this one is not in<br />
PCL format).
29<br />
SOURCE CODE MANAGER (SCM)<br />
Overview<br />
To simplify teamwork, a <strong>Source</strong> Code Manager is now available in WinDev Mobile. This <strong>Source</strong> Code<br />
Manager enables several developers to work together on the same project at the same time and to<br />
share elements among several projects.<br />
A database groups the project elements, each <strong>com</strong>puter<br />
has a local copy of the elements required for the development<br />
Part 1: Developing an application
30<br />
Operating mode of <strong>Source</strong> Code Manager<br />
The following example presents the <strong>Source</strong> Code Manager:<br />
Part 1: Developing an application<br />
If a project element (window, report, and so on) is checked out, this element cannot be checked out<br />
twice.<br />
Once the cheked-out element are modified, these elements must be checked back in to take these<br />
modifications into account. Indeed, the SCM database stores a history of all the project elements<br />
since their creation.<br />
Whenever an element is checked in, the version number of the source project is incremented by 1.
31<br />
PROJECT MONITORING CENTER<br />
The Project Monitoring Center helps you organize and schedule a project. It enables you to define<br />
the tasks that must be performed in a project, the developers, the durations, the progress status of<br />
the project, and so on.<br />
Operating mode of Project Monitoring Center<br />
Once the project tasks are listed, the Project Monitoring Center takes care of everything. Entering<br />
the time spent is almost automatic, it requires no specific action and it creates no particular<br />
constraint.<br />
When the relevant project is opened, the Project Monitoring Center requests or indicates the<br />
current task. As soon as a task is <strong>com</strong>pleted, all you have to do is indicate that this task is over and<br />
specify the new task.<br />
A task can be linked to a project element (window, report, and so on). Whenever the relevant<br />
element is opened, the time spent on this element is counted and stored in the Monitoring Center.<br />
Conversely, the element corresponding to the task you want to perform can be automatically<br />
opened from the task list.<br />
Each developer can also view his own task list in the "Project Monitoring Center" pane.<br />
Part 1: Developing an application
32<br />
ACTIVESYNC<br />
ActiveSync is a program used to synchronize data (WinDev application, email, calendar, contacts,<br />
tasks, notes, and so on) between a PC and a Pocket PC.<br />
In most cases, ActiveSync is supplied with the Pocket PC but it can also be downloaded from the<br />
Internet.<br />
ActiveSync automatically starts on the PC when the connection is established between the Pocket<br />
PC and the PC.<br />
The data to synchronize is configured in ActiveSync ("Options" icon).<br />
Part 1: Developing an application<br />
Features of ActiveSync<br />
ActiveSync is used to:<br />
• synchronize the data between a PC and a Pocket PC. See "Synchronizing the data" (page 54)<br />
for more details.<br />
• access the Pocket PC from a standard WinDev application.<br />
• handle a CEDB database from a standard WinDev application.<br />
• view from the PC the files found on the Pocket PC ("Explore" icon).<br />
• copy a file found on he PC to the Pocket PC (with the file explorer).<br />
• automatically convert the files copied to the Pocket PC. The format of the copied files will<br />
then correspond to the format of the files supported by the Pocket PC (for example, a ".DOC"<br />
file is converted into a ".PSW" file).<br />
• save the data found on the Pocket PC ("Tools .. Backup/Restore").<br />
• add applications to the Pocket PC and/or delete applications from the Pocket PC ("Tools ..<br />
Add/Remove programs").<br />
• transfer the Access databases to and from the Pocket PC ("Tools .. Import/Export database<br />
tables"). The Access databases correspond to CEDB databases on the Pocket PC.<br />
•etc.
33<br />
RUNNING THE TEST OF A WINDEV<br />
MOBILE APPLICATION<br />
Running the test of the entire project is used to simulate the start of the application by the<br />
executable. This enables you to run the test of the entire application, even if its development is not<br />
finished.<br />
Several types of project test are available in WinDev Mobile:<br />
• Run the test on the development <strong>com</strong>puter: this test simulates a Pocket PC on the<br />
development <strong>com</strong>puter. During this test, no connection to a Pocket PC is required. This test<br />
allows the use of the debugger. However, this test being run on a PC and not on a Pocket PC,<br />
the application may behave differently in some ways.<br />
• Run the test and debug on the Pocket PC connected to the development <strong>com</strong>puter. This test<br />
allows the use of the debugger while being directly run on the Pocket PC.<br />
• Run the test on the Pocket PC connected to the development <strong>com</strong>puter. In this case, the<br />
executable corresponding to the project is created, copied to the Pocket PC and run. When<br />
the program is run on the Pocket PC, the Pocket PC can be disconnected from the PC. The<br />
debugger is not available.<br />
Part 1: Developing an application
34<br />
UNIT TESTS<br />
The unit tests are used to run the test of windows, procedures and classes found in an application<br />
at different steps of development.<br />
To do so, select (or create) the test scenario that will be run.<br />
These scenarios are generated in WLanguage and they can be directly modified.<br />
These scenarios are grouped in the test editor. The test editor that analyzes the result of the unit<br />
tests and calculates the level of validation for the application.<br />
When creating the application executable, WinDev Mobile:<br />
- displays the level of validation for the application.<br />
- indicates the elements modified and not tested.<br />
Creating a test scenario<br />
Using a test scenario<br />
Window, class<br />
or procedure<br />
Test Editor<br />
Part 1: Developing an application<br />
Recording the<br />
test scenario<br />
WLanguage code of<br />
test scenario<br />
Running the test<br />
Result of the test<br />
Correction<br />
To create a unit test on the current window, click .<br />
To create a unit test on a procedure or a class, select this procedure or this class in the "Code" pane<br />
and select "Create a unit test" from the popup menu.
35<br />
UNIT TESTS ON THE EXECUTABLE<br />
WinDev Mobile enables you to run unit tests on the windows. However, these unit tests can only be<br />
run on the Pocket PC via the test robot. The test robot is used to run all the unit tests in real<br />
configuration on the Pocket PC.<br />
Configuring the test<br />
robot<br />
Test robot<br />
- Path of the executable (on<br />
the Pocket PC)<br />
- Path of the test data (on<br />
the Pocket PC)<br />
Saving the<br />
result<br />
Database of Control<br />
Centers<br />
Result of the tests<br />
WP120Test.DLL<br />
Running the executable on the<br />
Pocket PC in test mode. The test<br />
data is used.<br />
Executable deployed on<br />
the Pocket PC<br />
with:<br />
- its framework<br />
- its data files<br />
Test data on the Pocket PC<br />
with:<br />
-the test library (.WDL file)<br />
- the test data ("Automatic test data"<br />
directory)<br />
-the data files used for test (if<br />
necessary).<br />
The test robot runs the executable deployed on the Pocket PC in "test mode", via "WP120Test.DLL".<br />
The test data (scenarios, test data files if necessary, and so on) is automatically used.<br />
Part 1: Developing an application
36<br />
INSTALLING AN APPLICATION FOR POCKET<br />
PC<br />
Several methods can be used to install a WinDev application on a Pocket PC:<br />
• setup in CAB format. This setup program is run on a Pocket PC.<br />
• setup in MSI format. This setup program is run on a PC under Windows connected to a<br />
Pocket PC.<br />
• setup by direct copy of the executable from the PC to the Pocket PC.<br />
Setup in CAB format<br />
This setup consists in:<br />
• creating the application executable on the development <strong>com</strong>puter with WinDev Mobile.<br />
• generating the setup program of the application on the development <strong>com</strong>puter with WinDev<br />
Mobile. This setup program corresponds to a ".CAB" file.<br />
• copying the setup program on the Pocket PCs of the end users (via a memory card, by GPRS<br />
from an Internet site or via the file explorer).<br />
• running this setup program on the Pocket PCs. This program installs all the files required by<br />
the application. At the end of setup, the ".CAB" file is automatically deleted from the Pocket<br />
PC.<br />
Part 1: Developing an application<br />
To use this application, run the application on the Pocket PC (double-click the ".EXE" file for<br />
instance).
37<br />
Setup in MSI format<br />
This setup consists in:<br />
• creating the application executable on the development <strong>com</strong>puter with WinDev Mobile.<br />
• generating the setup program of the application on the development <strong>com</strong>puter with WinDev<br />
Mobile. This setup program corresponds to a ".MSI" file.<br />
• distributing this setup program to the end users.<br />
• running this setup program on the PCs. The application will be automatically installed on the<br />
Pocket PC connected to the current <strong>com</strong>puter.<br />
Note: If no Pocket PC is connected, the setup will be performed during the next<br />
synchronization between the PC and the Pocket PC.<br />
To use this application, run the application on the Pocket PC (double-click the ".EXE" file for<br />
instance).<br />
Part 1: Developing an application
38<br />
Setup by direct copy<br />
This feature is used to:<br />
• creating the application executable on the development <strong>com</strong>puter with WinDev Mobile.<br />
• automatically copy this executable to the Pocket PC connected to the current PC.<br />
To use this application, run this executable on the Pocket PC (double-click the ".EXE" file for<br />
instance).<br />
Windows PC<br />
Pocket PC<br />
Creating the<br />
executable<br />
(Pocket EXE)<br />
Connection: USB, Wi-Fi, Bluetooth...<br />
Direct COPY<br />
Execution<br />
Development<br />
Deployment<br />
Part 1: Developing an application
PART 2<br />
Database
41<br />
DATA HANDLED BY AN APPLICATION FOR<br />
POCKET PC<br />
The data handled by a WinDev Mobile application can <strong>com</strong>e from:<br />
• a Hyper File Mobile or Hyper File Client/Server database (".Fic" files).<br />
• an Oracle Lite, AS/400 or SQL Server Mobile database.<br />
• a CEDB database (".cdb" files).<br />
•".INI" files.<br />
• text files (in ANSI or UNICODE format).<br />
• the registry.<br />
Part 2: Database
42<br />
HYPER FILE MOBILE DATABASE<br />
The Hyper File Mobile format is the database format supplied with WinDev Mobile. This database<br />
format is <strong>com</strong>patible with WinDev, WinDev Mobile and WebDev.<br />
It is a freely distributable Relational DBMS.<br />
This format is identical to the Hyper File format of WinDev and WebDev (".WDD" file, data files, and<br />
so on).<br />
However, the available size on Pocket PC being restricted and the operating system of Pocket PC<br />
being limited, the following features are not supported by Hyper File Mobile in Classic mode:<br />
• the transactions.<br />
• the log process.<br />
• the management of file locks and record locks.<br />
• the management of files in Hyper File 5.5 format.<br />
Note: Only the files in Hyper File 5.5 format are not supported by Hyper File Mobile in Client/Server<br />
mode.<br />
Handling a Hyper File Mobile database from the Pocket PC<br />
A Hyper File Mobile database corresponds to a set of ".FIC", ".NDX" and ".MMO" files.<br />
Each data file can be handled by a WinDev Mobile application. These operations are performed via<br />
the Hyper File functions (Hxxx functions).<br />
Pocket PC<br />
WinDev Mobile<br />
application<br />
Part 2: Database<br />
Database<br />
Hxxx<br />
functions<br />
(Read,<br />
Write, ...)
43<br />
HYPER FILE CLIENT/SERVER DATABASE<br />
A Hyper File WinDev Mobile application can also operate in Client/Server mode.<br />
The characteristics of Client/Server mode are as follows:<br />
• A Hyper File Client/Server application is run on the different Pockets PCs (called client<br />
<strong>com</strong>puters).<br />
• The data files are found on a server. Only the server physically accesses the data files.<br />
• All the processes (query, read/add to file, and so on) are performed on the server.<br />
Part 2: Database
44<br />
STANDARD CEDB DATABASE<br />
The standard Pocket PC applications<br />
The Pocket PCs are supplied with a set of standard applications that handle the standard CEDB<br />
databases.<br />
These databases correspond to the databases found by default on the Pocket PC. These databases<br />
contain the "Tasks", "Contacts" and "Calendar" data files, and so on.<br />
These databases can be handled by a WinDev Mobile application.<br />
Part 2: Database
45<br />
Handling a standard database of Pocket PC (from a PC)<br />
A standard database (containing the data files for managing tasks, contacts, and so on) is found on<br />
the Pocket PC. This database can be handled by a WinDev Mobile application.<br />
If you own WinDev, you also have the ability to create a WinDev application used to directly handle<br />
this standard database of Pocket PC.<br />
These operations are performed via the cdbXXX functions.<br />
The synchronization between the database of Pocket PC and the data viewed via Outlook is<br />
performed by ActiveSync.<br />
Windows PC<br />
Pocket PC<br />
WinDev<br />
Application<br />
Connection: USB, Wi-Fi, Bluetooth...<br />
cdbxxx functions (Read, Write...)<br />
WinDev Mobile<br />
Application<br />
Outlook<br />
Synchronization via ActiveSync<br />
Standard<br />
database<br />
cdbxxx<br />
functions<br />
(Read,<br />
Write, ...)<br />
Note: To handle a Pocket PC database from a standard WinDev application, the Windows PC must<br />
be connected to the Pocket PC (ceConnect).<br />
Part 2: Database
46<br />
HANDLING CUSTOM CEDB DATABASES<br />
CEDB database<br />
The custom CEDB databases correspond to Access databases (".MDB" file) previously exported<br />
from a PC.<br />
When an Access database (".MDB" file) is copied to a Pocket PC from the file explorer, this database<br />
is automatically changed into a CEDB database (".CDB" file).<br />
Handling a Pocket PC database (CEDB) from the Pocket PC<br />
A CEDB database can be handled by a WinDev Mobile application. These operations are performed<br />
via the cdbXXX functions.<br />
Pocket PC<br />
WinDev Mobile<br />
Application<br />
Part 2: Database<br />
Database<br />
cdbxxx<br />
functions<br />
(Read,<br />
Write, ...)
47<br />
Handling a Pocket PC database (CEDB) from the Windows PC<br />
If you own WinDev, you also have the ability to create a WinDev application used to directly handle a<br />
CEDB database found on the Pocket PC. These operations are also performed via the cdbXXX<br />
functions.<br />
Windows PC<br />
Pocket PC<br />
WinDev Mobile<br />
Application<br />
Connection: USB, Wi-Fi, Bluetooth...<br />
WinDev<br />
Application<br />
cdbxxx functions (Read, Write, ...)<br />
Database<br />
cdbxxx<br />
functions<br />
(Read,<br />
Write...)<br />
Note: To handle a Pocket PC database from a standard WinDev application, the Windows PC must<br />
be connected to the Pocket PC (ceConnect).<br />
Part 2: Database
48<br />
Synchronizing a Pocket PC database (CEDB) with an Access database<br />
An Access database (".MDB" file) is found on the Windows PC. This database is exported to the<br />
Pocket PC: ActiveSync automatically transforms it into a Pocket PC database (".CDB" file).<br />
This Pocket PC database can be handled by a WinDev Mobile application.<br />
If you own WinDev, you also have the ability to create a WinDev application used to handle the<br />
Pocket PC database.<br />
These operations are performed via the cdbXXX functions. The synchronization between the<br />
database of Pocket PC and the Access database is performed by ActiveSync.<br />
Windows PC<br />
Pocket PC<br />
WinDev<br />
Application<br />
Connection: USB, Wi-Fi, Bluetooth...<br />
cdbxxx functions (Read, Write ...)<br />
Synchronization via ActiveSync<br />
WinDev Mobile<br />
Application<br />
cdbxxx<br />
functions<br />
(Read,<br />
Write...)<br />
Database<br />
Database<br />
Part 2: Database<br />
Notes:<br />
• To handle a Pocket PC database from a standard WinDev application, a connection must be<br />
established between the Windows PC and the Pocket PC (ceConnect).<br />
• The standard WinDev application can also handle the Access database via the native Access<br />
access.
49<br />
HANDLING THE CEDB DATABASES IN<br />
WLANGUAGE<br />
WLanguage functions used to handle the CEDB databases:<br />
cdbAdd<br />
cdbCancelSearch<br />
cdbClose<br />
cdbCol<br />
cdbDateTimeToInteger<br />
cdbDelete<br />
cdbFound<br />
cdbIntegerToDateTime<br />
cdbListFile<br />
cdbModify<br />
cdbNbCol<br />
cdbNbRec<br />
cdbOpen<br />
cdbOut<br />
cdbRead<br />
cdbReadFirst<br />
Adds the record found in memory to a data file<br />
Cancels the current search criterion<br />
Closes a database (".CDB" file)<br />
Returns information about a column found in the current record<br />
Transforms a DateTime variable into a value <strong>com</strong>patible with a Date and Time<br />
column (unsigned 8-byte integer)<br />
Deletes the current record or the specified record from the data file<br />
Checks whether the current record matches the current search<br />
Transforms the value of a Date and Time column (unsigned 8-byte integer) into a<br />
DateTime variable<br />
Lists the data files found in a CEDB database<br />
Modifies the specified record (or the record found in memory) in the data file<br />
Returns the number of columns found in the record in memory<br />
Returns the number of records found in a data file<br />
Opens a database (".CDB") on the pocket PC connected to the current <strong>com</strong>puter<br />
Enables you to find out whether the record you want to point to is outside the file<br />
Reads a record in a file according to a record number<br />
Points to the first record in a file and reads it<br />
cdbReadLast<br />
cdbReadNext<br />
cdbReadPrevious<br />
cdbReadSeek<br />
cdbRecNum<br />
cdbReset<br />
Points to the last record in a file and reads it<br />
Points to the next record in a file and reads it<br />
Points to the previous record in a file and reads it<br />
Points to the first file record whose value for a specific column is equal to a sought<br />
value<br />
Returns the number of the current record in the data file<br />
Resets all the variables found in a structure of the standard database<br />
Part 2: Database<br />
cdbWriteCol<br />
Modifies the value of a column for a record in memory
50<br />
COMPARING HYPER FILE MOBILE AND<br />
CEDB<br />
To display information <strong>com</strong>ing from a database in a window, the controls of this window must be<br />
linked to the different items of the database.<br />
The method for displaying and retrieving information depends on the database used (Hyper File<br />
Mobile or CEDB).<br />
File link between a window and a Hyper File Mobile database<br />
In most cases, the link between a control and an item is defined in the window editor when the<br />
control is described ("File" tab). This link enables you to specify the file item that will be used by<br />
ScreenToFile and FileToScreen.<br />
Pocket PC<br />
HYPER FILE<br />
1 LINE<br />
PER WINDOW<br />
( File link )<br />
Part 2: Database<br />
ScreenToFile<br />
FileToScreen
51<br />
File link between a window and a Pocket PC database (CEDB)<br />
This link can be defined by programming only (cdbXXX functions).<br />
Pocket PC<br />
CEDB<br />
1 LINE<br />
PER CONTROL<br />
( No file link )<br />
cdbWriteCol("MyDataBase",...<br />
"Schedule","Caption",ctlCaption)<br />
cdbWriteCol("MyDataBase",...<br />
"Schedule","Contrib",ctlContrib)<br />
...<br />
ctlCaption=cdbCol("MyDataBase",...<br />
"Schedule","Caption")<br />
ctlContrib=cdbCol("MyDataBase",...<br />
"Schedule","Contrib")<br />
...<br />
Other differences<br />
The use of Hyper File Mobile databases enables you to access the following features (nonexhaustive<br />
list):<br />
• Speed of the Hyper File Mobile database.<br />
• Queries on Hyper File Mobile databases (created by the query editor).<br />
• Fast application development via Full Application RAD.<br />
• Features specific to the Hyper File Mobile database (encryption, and so on)<br />
Part 2: Database
52<br />
THE QUERIES<br />
A query is used to interrogate a database in order to view, insert, modify or delete data. The<br />
structure of the query defines the data used.<br />
A query can interrogate one or more files.<br />
The query editor is used to easily create queries, without programming.<br />
Window and controls of<br />
a window ("Content"<br />
tab)<br />
Query<br />
Reports<br />
The result of the query<br />
is handled as a file<br />
Programming<br />
(use in the WLanguage<br />
functions)<br />
Part 2: Database<br />
Data <strong>com</strong>ing from one or more<br />
files (Hyper File, Oracle, and<br />
so on)<br />
Queries
53<br />
THE EMBEDDED QUERIES<br />
The controls found in a window can be linked to a data file or to an existing query. These controls<br />
can also be linked to a query created when the control is designed.<br />
Embedded query: MyWindow_1$Query<br />
In this case, the query is embedded in the window. It is found in the WPW file corresponding to the<br />
window. If the WPW file is transmitted, the embedded queries used by this window will also be<br />
supplied.<br />
Part 2: Database
54<br />
SYNCHRONIZING THE DATA<br />
WinDev Mobile can be used to synchronize the records used by several applications.<br />
The two applications manage the same data independently of each other. During the<br />
synchronization, the changes made to the database handled by the PC are automatically applied to<br />
the Pocket PC (and conversely).<br />
This synchronization is automatically performed by:<br />
• ActiveSync when the Pocket PC is connected to the Windows PC.<br />
•the Universal Replication when the Pocket PC is connected (or not) to the Windows PC.<br />
ActiveSync<br />
ActiveSync is used to update databases of same format used by both a standard WinDev<br />
application and a WinDev Mobile application.<br />
The synchronization can be adapted to special cases. For instance, you have the ability to retrieve<br />
the records concerning a specified product or the records created at a given date, manage the<br />
conflicts, display a setting window, and so on.<br />
These changes must be done by programming in a set of procedures called "WDSynchro.wdg". This<br />
set of procedures is supplied with WinDev Mobile.<br />
Note: No programming is required to perform a full synchronization.<br />
Windows PC<br />
Pocket PC<br />
WinDev<br />
Application<br />
ActiveSync<br />
Connection: USB, Wi-Fi, Bluetooth...<br />
Synchronization via ActiveSync<br />
WinDev<br />
Mobile<br />
Application<br />
File 1<br />
Part 2: Database<br />
File 1<br />
File 2<br />
File 3<br />
Note: WDSynchro is used to configure ActiveSync in order to synchronize the Hyper File database<br />
(PC) and the Hyper File Mobile database (Pocket PC). This tool can be used on the development<br />
<strong>com</strong>puter only.<br />
File 2
55<br />
Universal replication<br />
The universal replication is used to update databases of same format or databases of different<br />
formats used by several applications. You can for instance perform a synchronization between a<br />
Hyper File Mobile database and an Oracle Lite database.<br />
The universal replication uses a centralized model: all the databases are synchronized with a<br />
master database. Then, the master database propagates the modifications to the other databases.<br />
The synchronization can be adapted to special cases. For instance, you have the ability to retrieve<br />
the records concerning a specified product or the records created at a given date, manage the<br />
conflicts, display a setting window, and so on.<br />
These changes must be done by programming via HRplFilterProcedure.<br />
Part 2: Database
56<br />
3-TIER<br />
The 3-tier architecture is designed to separate the 3 "tiers" of an application: UI, processes and<br />
data.<br />
An application will be made of 3 separate tiers:<br />
• a presentation tier,<br />
• a process tier,<br />
• a data tier.<br />
The reason for separating them is to facilitate maintenance and future upgrades of the application.<br />
This ensures higher security because the access to the database is allowed via the process tier<br />
only. It also optimizes teamwork and multi-target development.<br />
Part 2: Database
PART 3<br />
Programming in<br />
WLanguage
59<br />
WLANGUAGE FUNCTIONS<br />
Most of the WLanguage functions found in WinDev are also available in WinDev Mobile. These<br />
functions are <strong>com</strong>mon to the two products.<br />
Only the functions specific to Windows are not available in WinDev Mobile, because Windows for<br />
Pocket PC is more limited.<br />
The following diagram presents the WLanguage functions that can be used according to the type of<br />
application developed:<br />
Common<br />
functions<br />
WinDev Mobile<br />
functions only<br />
Functions that can only be<br />
used on Pocket PC<br />
(management of SIM card<br />
for instance)<br />
WinDev functions<br />
for Windows only<br />
Functions not available due to<br />
the limits of Pocket PC (for<br />
instance, fCurrentDir cannot be<br />
used as no current directory<br />
exists on Pocket PC)<br />
for instance:<br />
HReadFirst,<br />
FileToScreen,<br />
ExtractString...<br />
Part 3: Programming in WLanguage
60<br />
HANDLING CHARACTER STRINGS<br />
Different formats of character strings are available:<br />
• The UNICODE format is used to describe a very large set of characters by representing each<br />
letter on 2 bytes. This format means that 65,536 characters can be encoded. All the<br />
characters of the 24 most <strong>com</strong>mon character sets are represented in a single set. Each<br />
character has a unique identifier. This format is used to simultaneously handle characters<br />
<strong>com</strong>ing from different character sets.<br />
• The ANSI format represents each character on one byte. This format can encode 256<br />
characters in the Indo-European character sets. This format can represent all the character<br />
sets. However, a single character set can be used at a time.<br />
Character strings in Pocket PC<br />
In most cases, the Windows applications for Pocket PC handle character strings in UNICODE<br />
format.<br />
Pocket PC<br />
Part 3: Programming in WLanguage<br />
Using Text files<br />
or<br />
ANSI<br />
UNICODE<br />
S is string<br />
...<br />
fOpen(MyFile,ANSI)<br />
fReadLine(...)<br />
fOpen(MyFile,Unicode)<br />
fReadLine(...)<br />
UNICODE<br />
string<br />
UNICODE<br />
string<br />
UNICODE<br />
string<br />
In pocket PC, when using text files containing character string in ANSI format, WinDev Mobile<br />
automatically converts these character strings into UNICODE format. This conversion is performed
61<br />
even if the opening of this file in ANSI format is explicitly requested.<br />
This conversion is <strong>com</strong>pletely transparent.<br />
Reminder: Character string in Windows PC<br />
The Windows applications for PC handle character strings in ANSI format.<br />
On a PC, text files can be opened in ANSI format and in UNICODE format. No conversion is<br />
performed by default.<br />
Windows PC<br />
S is string<br />
...<br />
ANSI<br />
string<br />
Using Text files<br />
or<br />
ANSI<br />
UNICODE<br />
fOpen(MyFile,ANSI)<br />
fReadLine(...)<br />
fOpen(MyFile,Unicode)<br />
fReadLine(...)<br />
ANSI<br />
string<br />
UNICODE<br />
string<br />
The character strings are programmed in the same way in WinDev and in WinDev Mobile (with<br />
very few exceptions). WinDev automatically performs the necessary conversions.<br />
Part 3: Programming in WLanguage
62<br />
FILE PICKER AND PATHS ON POCKET PC<br />
File picker<br />
In Pocket PC, the file picker is used to select the files found:<br />
• in the "\My Documents" directory or in one of its immediate sub-directories.<br />
• in a directory found at the root of a storage card.<br />
Therefore, fSelect can only be used to select a file found in one of these directories.<br />
Part 3: Programming in WLanguage<br />
Path of directories and files<br />
The directories are managed in different ways on a PC and on a Pocket PC.<br />
On a PC, the paths have the following format: "C:\MyDocuments\MyFile.txt". On a Pocket PC, the<br />
paths have the following format: "\MyDocuments\MyFile.txt". There are several tree structures and<br />
the notion of drive does not exist.<br />
Note: The notion of current directory does not exist in Windows for Pocket PC (limit of the operating<br />
system). This is the reason why the functions that handle the current directory (fCurrentDir for<br />
instance) are not available in WinDev Mobile.
63<br />
MANAGING THE KEYBOARD<br />
To allow the users of your applications to enter information, the keyboard of the Pocket PC (also<br />
called SIP for "Software Input Panel") must be managed. This keyboard is used to:<br />
•display a miniature keyboard at the bottom of<br />
the screen. The user clicks this keyboard with<br />
the stylus to enter information:<br />
•automatically recognize the different<br />
words written directly on the screen with<br />
the stylus (method called "Transcriber").<br />
•automatically recognize the letters entered in a<br />
specific character set (method called "Letter<br />
Recognizer"):<br />
•automatically recognize the blocks of<br />
words entered in a specific character set<br />
(method called "Block Recognizer"):<br />
WinDev Mobile enables you to easily manage this keyboard via the WLanguage functions (SIPXXX<br />
functions).<br />
Note: On a Smartphone, the input is performed via the numeric keypad.<br />
Part 3: Programming in WLanguage
64<br />
FUNCTIONS SPECIFIC TO POCKET PC<br />
Functions for managing the keyboard<br />
These functions enable you to easily manage the keyboard used on the Pocket PC:<br />
SIPList<br />
SIPMode<br />
SIPVisible<br />
Returns the list of keyboards available for the Pocket PC<br />
Enables you to find out and modify the keyboard currently used<br />
Enables you to find out whether the current keyboard is enabled/<br />
visible and to make the keyboard enabled/visible<br />
Functions for managing the SIM card<br />
These functions enable you to easily manage the information found in the personal directory<br />
present on a SIM card. These functions are available for "Pocket phones" and Smartphones only.<br />
SIMDelete<br />
Deletes an entry from the directory of the SIM card<br />
Part 3: Programming in WLanguage<br />
SIMNbContact<br />
SIMRead<br />
SIMWrite<br />
Returns the number of entries found in the directory of the SIM card<br />
Reads an entry in the directory of the SIM card<br />
Writes or modifies an entry in the directory of the SIM card<br />
Functions for managing the automatic start of an application<br />
These functions enable you to manage the automatic start of an application:<br />
AutoRunAdd<br />
AutoRunDelete<br />
Automatically starts a WinDev Mobile application when a specific event<br />
occurs. This startup is defined from a WinDev Mobile application.<br />
Stops the automatic startup of a WinDev Mobile application.
PART 4<br />
Communication
67<br />
COMMUNICATION WITH WINDEV MOBILE<br />
WinDev Mobile can be used to establish <strong>com</strong>munication between two Pocket PCs, a Pocket PC and<br />
a Smartphone, a Pocket PC and a PC, and so on.<br />
These "dialogs" are performed by infrared, Wi-Fi, GPRS, and so on.<br />
Summary table<br />
The table below presents the <strong>com</strong>munication modes available for each feature proposed by WinDev<br />
Mobile.<br />
Remote<br />
access (RPC<br />
on Hyper<br />
File)<br />
Email FTP HTTP Telephony<br />
SOAP<br />
J2EE<br />
.NET<br />
Socket<br />
SMS<br />
ActiveSync X X X X X X<br />
Network card X X X X X X<br />
GPRS X X X X X X<br />
Infrared<br />
X<br />
Smartphone<br />
or access<br />
by phone<br />
(GSM type)<br />
X<br />
X<br />
Wi-Fi X X X X X X<br />
Part 4: Communication
68<br />
Some examples<br />
1. Communication by Infrared<br />
The <strong>com</strong>munication via infrared is performed by the Socket functions (SocketConnectInfrared,<br />
SocketCreateInfrared, and so on). The following devices can <strong>com</strong>municate:<br />
• two Pocket PCs between themselves.<br />
• a Pocket PC with a Smartphone.<br />
• a Pocket PC with a PC.<br />
• a Pocket PC with any device equipped with an infrared port (printer, electric gate, and so on).<br />
2. Communication by Wi-Fi<br />
The <strong>com</strong>munication by Wi-Fi can be used to transfer files by FTP for instance.<br />
Part 4: Communication<br />
FTP Server<br />
FTP account<br />
Anonymous<br />
File transfer<br />
by Wi-Fi<br />
(FTPxxxx functions )<br />
Pocket PC<br />
WinDev<br />
Mobile<br />
application<br />
Connection to server<br />
(FTPConnect function)
69<br />
3. Communication by GPRS<br />
The <strong>com</strong>munication by GPRS can be used to access a remote Hyper File database via the Internet<br />
for instance.<br />
PC<br />
Pocket PC<br />
WinDev<br />
Mobile<br />
application<br />
Internet<br />
Intranet<br />
Gprs<br />
Connection to remote database<br />
(HConnectRemoteAccess function)<br />
Gprs<br />
Connection to Internet<br />
(NetOpenRemoteAccess function)<br />
Part 4: Communication
70<br />
MANAGING EMAILS (POP3/SMTP<br />
PROTOCOL)<br />
The POP3 and SMTP protocols are email management protocols supported by all the Internet<br />
Service Providers. These protocols allow you to dialog with the email server available at your ISP.<br />
Notes:<br />
• The POP3 protocol is used to receive emails.<br />
• The SMTP protocol is used to send emails.<br />
Pocket PC<br />
WinDev<br />
Mobile<br />
Application<br />
POP3 Protocol<br />
In<strong>com</strong>ing emails<br />
SMTP Protocol<br />
Outgoing emails<br />
Connection : Ethernet card,<br />
Wi-Fi, Modem GPRS...<br />
In<strong>com</strong>ing and<br />
outgoing emails<br />
Email server<br />
(Host)<br />
Part 4: Communication<br />
Principle<br />
1. Connect the Pocket PC to a PC (required if the Pocket PC if not equipped with an Ethernet<br />
card or a GPRS modem).<br />
2. Connect to the Internet Service Provider (if necessary).<br />
3. Start an email session with EmailStartSession.<br />
4. Send and read messages.<br />
5. Close the email session with EmailCloseSession.
71<br />
MANAGING EMAILS (CEMAPI)<br />
CEMAPI is an email management API used by most of the Pocket PC applications to send and<br />
receive emails (Pocket Outlook in most cases).<br />
CEMAPI simplifies the management of the emails received by the host. When an email is read, it is<br />
automatically loaded in the local message box and deleted from the server (at the host).<br />
All the characteristics required to manage the emails (POP3 protocol, SMTP protocol, remote<br />
access, and so on) are grouped in the "User Account".<br />
With the email functions of WLanguage, a WinDev application can directly handle the emails<br />
managed in a application that uses "CEMAPI".<br />
Using the "ActiveSync" user account<br />
A user account defined in Pocket Outlook is required to manage the emails with CEMAPI. By<br />
default, Pocket Outlook manages the "ActiveSync" user account.<br />
Pocket PC<br />
WinDev<br />
Mobile<br />
application<br />
Outlook<br />
Pocket<br />
ActiveSync<br />
account<br />
Connection: USB,<br />
Wi-Fi, Bluetooth...<br />
Synchronization<br />
via ActiveSync<br />
PC<br />
Outlook<br />
Connection: Internet<br />
In<strong>com</strong>ing and<br />
outgoing emails<br />
Email server<br />
(Host)<br />
Part 4: Communication
72<br />
Using a specific user account<br />
To use another user account, you must define one.<br />
If the Pocket PC has no direct Internet link, a synchronization with the PC is required to send and<br />
receive emails.<br />
Pocket PC<br />
WinDev<br />
Mobile<br />
Application<br />
Outlook<br />
Pocket<br />
Connection: USB,<br />
Wi-Fi, Bluetooth...<br />
In<strong>com</strong>ing and<br />
outgoing emails<br />
PC<br />
Other<br />
accounts<br />
Connection: Internet<br />
In<strong>com</strong>ing and<br />
outgoing emails<br />
Email server<br />
(Host)<br />
Part 4: Communication<br />
If the Pocket PC has direct Internet access (by Wi-Fi, and so on), no synchronization with the PC is<br />
required.
73<br />
HANDLING FILES ON AN FTP SERVER<br />
FTP (File Transfer Protocol) is a standard protocol used to transfer files from one site to another.<br />
This protocol is used to exchange files via TCP/IP, Wi-Fi Internet or Active Sync.<br />
Several thousand file servers can be accessed by FTP on Internet. These servers propose<br />
shareware or freeware to the public.<br />
Several WLanguage functions allow you to manage files on an FTP server from your WinDev Mobile<br />
applications.<br />
Transferring files by direct link between a Pocket PC and an FTP server by Wi-Fi:<br />
FTP Server<br />
FTP account<br />
Pocket PC<br />
WinDev<br />
Mobile<br />
application<br />
Anonymous<br />
File transfer<br />
by Wi-Fi<br />
(FTPxxxx functions )<br />
Connection to server<br />
(FTPConnect function)<br />
Transferring files by Internet:<br />
FTP Server<br />
FTP account<br />
Anonymous<br />
Internet<br />
Intranet<br />
PC<br />
Connection: USB, Wi-Fi, Bluetooth...<br />
File recovery<br />
FTPGet function<br />
Pocket PC<br />
WinDev<br />
Mobile<br />
application<br />
Part 4: Communication
74<br />
MANAGING SMSS<br />
With the WLanguage functions, WinDev Mobile enables you to:<br />
• send SMSs.<br />
• read the in<strong>com</strong>ing SMSs.<br />
• delete one or more in<strong>com</strong>ing SMSs.<br />
An SMS (Short Message Service) is a text message (up to 160 characters) sent on a cell phone.<br />
To use the SMS functions, the Pocket PC application must be installed:<br />
• on a Pocket PC with phone access (GSM type).<br />
•on a Smartphone.<br />
Pocket PC<br />
SMS<br />
application<br />
PCSoft<br />
Cell phone,<br />
Smartphone<br />
Sending the message<br />
(SMSSend function)<br />
Creating the message<br />
(SMS structure)<br />
Receiving the message<br />
Part 4: Communication
PART 5<br />
Interactions between<br />
WinDev - WinDev Mobile
77<br />
INTERACTION WITH A STANDARD WINDEV<br />
APPLICATION<br />
The functions for accessing the Pockets PCs are used to access the Pocket PCs from a standard<br />
WinDev application.<br />
Windows PC<br />
Pocket PC<br />
WinDev<br />
Application<br />
WD120CE.DLL<br />
WinDev Mobile is supplied with several examples that use the functions for accessing Pocket PCs:<br />
•PC Registry.<br />
•PC Explorer.<br />
These examples can be run on a PC.<br />
Connection: USB, Wi-Fi, Bluetooth...<br />
Copy files<br />
Run applications<br />
cdbxxx access (Read, write...)<br />
File<br />
WinDev Mobile<br />
Application<br />
Database<br />
Part 5: Interactions between WinDev - WinDev Mobile
78<br />
POCKET PC: SHARING WINDEV<br />
ELEMENTS<br />
Part 5: Interactions between WinDev - WinDev Mobile<br />
The same WinDev elements (analysis, reports, queries, and so on) can be used in a standard<br />
WinDev application and in a WinDev Mobile application:<br />
• Windows: The windows found in WinDev and in WinDev Mobile do not have the same format<br />
(different size, position of menus, and so on). The WinDev windows can be imported into a<br />
WinDev Mobile project. The WinDev windows (".WDW" file) are automatically changed into<br />
windows for Pocket PC (".WPW" file).<br />
• Help: This type of element does not exist in Pocket PC.<br />
• Analysis, reports, queries, classes, sets of procedures, and so on: These elements can be<br />
shared between a standard WinDev application and a WinDev Mobile application.<br />
WINDEV<br />
Project (.wdp)<br />
Windows (.wdw)<br />
Help<br />
Share<br />
Import<br />
Analysis<br />
Reports<br />
Sets of<br />
procedures<br />
Classes<br />
Share<br />
WINDEV<br />
Mobile<br />
Project (.wpp)<br />
Windows (.wpw)
79<br />
HANDLING A POCKET PC FROM A<br />
STANDARD WINDEV APPLICATION<br />
The following WLanguage functions are used to access the Pocket PCs from a standard WinDev<br />
application:<br />
ceConnect<br />
ceConnectionStatus<br />
Connects the current <strong>com</strong>puter to a Pocket PC<br />
Enables you to find out the status of the connection between the current<br />
<strong>com</strong>puter and the Pocket PC<br />
ceCopyFile<br />
ceCreateShortcut<br />
ceDeleteFile<br />
ceDeleteShortcut<br />
ceDir<br />
ceDisconnect<br />
ceFileDate<br />
ceFileExist<br />
ceFileSize<br />
ceFileTime<br />
ceListFile<br />
ceMachineName<br />
ceMakeDir<br />
ceOEMInfo<br />
cePlatform<br />
Copies:<br />
- a file found on the current <strong>com</strong>puter to the connected Pocket PC<br />
- a file found on the connected Pocket PC to the current <strong>com</strong>puter<br />
- a file found on the connected Pocket PC to another directory in the<br />
Pocket PC<br />
Creates a shortcut on the Pocket PC connected to the current <strong>com</strong>puter<br />
Deletes a file from the Pocket PC connected to the current <strong>com</strong>puter<br />
Deletes a shortcut previously created by ceCreateShortcut<br />
Searches for a file or for a directory on the Pocket PC connected to the<br />
current <strong>com</strong>puter<br />
Closes the connection between the current <strong>com</strong>puter and the Pocket PC<br />
Returns or modifies the different dates associated with a file (creation,<br />
modification or access)<br />
Checks the existence of a file<br />
Returns the size (in bytes) of a file found on the Pocket PC connected to<br />
the current <strong>com</strong>puter<br />
Returns or modifies the different times associated with a file (creation,<br />
modification or access)<br />
Lists the files found in a directory (and in its sub-directories) and returns<br />
the number of listed files<br />
Returns the name of the Pocket PC<br />
Creates a directory on the Pocket PC connected to the current <strong>com</strong>puter<br />
Returns the OEM information of the Pocket PC: trademark, model, serial<br />
number, and so on.<br />
Returns the name of the Pocket PC platform<br />
Part 5: Interactions between WinDev - WinDev Mobile<br />
cePowerStatus<br />
Returns information about the battery (main or spare) of the Pocket PC
80<br />
ceProcessorType<br />
ceRegistryCreateKey<br />
ceRegistryDeleteKey<br />
ceRegistryDeleteValue<br />
ceRegistryExist<br />
ceRegistryFirstSubKey<br />
Returns the type of processor for the Pocket PC connected to the current<br />
<strong>com</strong>puter<br />
Creates a key in the registry of Pocket PC<br />
Deletes a sub-key from the registry of Pocket PC<br />
Deletes a value from the registry of Pocket PC<br />
Checks the existence of a key in the Pocket PC registry<br />
Identifies the key found after the specified key in the registry of Pocket PC<br />
Part 5: Interactions between WinDev - WinDev Mobile<br />
ceRegistryListValue<br />
ceRegistryNextKey<br />
ceRegistryQueryValue<br />
ceRegistrySetValue<br />
ceRegistrySubKey<br />
ceRemoveDir<br />
ceRunExe<br />
ceSysDir<br />
ceWindowsVersion<br />
ceWinEnum<br />
ceWinTitle<br />
ceXRes<br />
ceYRes<br />
Returns the name and possibly the type of the values for a key found in<br />
the Pocket PC registry<br />
Identifies the key found after the specified key in the registry of Pocket PC<br />
Reads the value of a register in the Pocket PC registry<br />
Writes a value into a register of the Pocket PC registry<br />
Identifies the path of the Nth specified sub-key in the registry of Pocket PC<br />
Deletes a directory from the Pocket PC connected to the current <strong>com</strong>puter<br />
Runs a program (an executable for instance) from the current application<br />
Returns the path of a system directory for the Pocket PC connected to the<br />
current <strong>com</strong>puter<br />
Returns information about the Windows version used on the Pocket PC<br />
connected to the current <strong>com</strong>puter<br />
Enables you to enumerate the Windows windows currently opened on the<br />
Pocket PC<br />
Returns the title of the specified Windows window<br />
Returns the horizontal resolution of the screen for the Pocket PC<br />
connected to the current <strong>com</strong>puter<br />
Returns the vertical resolution of the screen for the Pocket PC connected<br />
to the current <strong>com</strong>puter<br />
Reminder: You can also use the cdbXXX functions (listed page 49).
PART 6<br />
Appendices
83<br />
NEW FEATURES IN WINDEV MOBILE 12<br />
Read this section if you are familiar with WinDev Mobile 11.<br />
WinDev Mobile 12 presents several new features.<br />
Work environment<br />
The new features of the work environment:<br />
• Project Editor:<br />
•New RAD (Rapid Application Development)<br />
•Internet <strong>com</strong>ponent<br />
• Data Model Editor:<br />
•Multilingual name for items and files<br />
•The analysis groups can be handled by programming<br />
•Window Editor:<br />
•New catalog of images.<br />
•Refactoring a selection of controls into control template.<br />
•Templates of control templates.<br />
•Templates of window templates.<br />
•Style inheritance.<br />
•New sort options in list boxes and tables.<br />
•Memory column and ’check box’ column in browsing tables.<br />
•Table: ’progress bar’ column, cell merge.<br />
•Browsing table loaded in memory.<br />
• Code Editor:<br />
•Go of global procedure.<br />
•’Trace’ pane of the debugger to display the result of the trace during the last test.<br />
•Automated test of a window.<br />
•Iterations in automated tests.<br />
•Test robot to run tests on the Pocket PC.<br />
• Hyper File Client/Server:<br />
•Hot backup.<br />
•Programmed task on the server<br />
•Server triggers.<br />
• <strong>Source</strong> Code Manager:<br />
•Window automatically checked out when it is modified.<br />
•Management of rights.<br />
•Management of physical change of <strong>com</strong>puter.<br />
•Masking the analysis files.<br />
Part 6: Appendices
84<br />
•Ability to process the tasks and the bugs during the checkout.<br />
Programming<br />
The new programming features:<br />
• Hyper File: unicode items.<br />
• Emulating cameras and video recording<br />
• New functions:<br />
•Functions for managing video resolution<br />
•ArrayToString and StringToArray<br />
•SNMP functions<br />
•Functions for managing services<br />
•Functions for managing the recycle bin<br />
•…<br />
Part 6: Appendices
85<br />
TOOLS AVAILABLE FOR WINDEV MOBILE<br />
Specific tools are available for using a Pocket PC from a PC:<br />
WDExplorer<br />
Tool used to view the files and directories found on a<br />
Pocket PC, a Smartphone, etc.<br />
WDRegistry<br />
Tool used to view the registry of a Pocket PC, a<br />
Smartphone, etc.<br />
WDCEDB<br />
Tool used to access the standard databases (.cdb)<br />
found on a Pocket PC, a Smartphone, etc.<br />
WDCapture<br />
Tool used to perform screen shots or videos of the<br />
connected Pocket PC or Smartphone.<br />
WDSynchro<br />
Tool for configuring the Hyper File Mobile synchronizations via ActiveSync.<br />
Part 6: Appendices
86<br />
COMPONENTS SUPPLIED WITH WINDEV<br />
MOBILE<br />
The examples of <strong>com</strong>ponents supplied with WinDev Mobile are divided into 2 categories:<br />
• <strong>com</strong>ponents that can be used from a WinDev Mobile application.<br />
These <strong>com</strong>ponents are found in the "Components\Sample Components\Mobile" subdirectory<br />
of the setup directory of WinDev Mobile.<br />
Name of the <strong>com</strong>ponent<br />
Pocket Directory Picker<br />
Pocket GANTT<br />
Description<br />
Directory picker for Pocket PC.<br />
Used to display a GANTT chart in a memory table or in a<br />
window included in the <strong>com</strong>ponent.<br />
• <strong>com</strong>ponents that can be used from a standard WinDev application that handles the files of<br />
Pocket PC.<br />
These <strong>com</strong>ponents are found in the "Components\Sample Components\Windows" subdirectory<br />
of the setup directory of WinDev Mobile.<br />
Name of the <strong>com</strong>ponent<br />
PC Directory Picker<br />
PC File Picker<br />
Description<br />
Selecting a directory found on a Pocket PC from a standard<br />
WinDev application.<br />
Selecting files found on a Pocket PC from a standard<br />
WinDev application.<br />
Two sub-directories are specific to each one of these examples:<br />
• the "-Example" sub-directory contains an example of project that uses the<br />
<strong>com</strong>ponent.<br />
• the "-<strong>Source</strong>" sub-directory contains the <strong>com</strong>ponent project.<br />
Part 6: Appendices<br />
Additional <strong>com</strong>ponents are supplied with the Newsletter of Technical Support (LST) or can be<br />
downloaded from our site (<strong>www</strong>.<strong>windev</strong>.<strong>com</strong>).
87<br />
EXAMPLES SUPPLIED WITH WINDEV<br />
MOBILE<br />
The examples supplied with WinDev Mobile are intended to help you learn the features of WinDev<br />
Mobile.<br />
Their source code is presented in details.<br />
These examples are found in the "Examples" sub-directory of the setup directory of WinDev Mobile<br />
and they can be opened directly from the "Wizards, Examples and Components" pane.<br />
Different types of examples are supplied with WinDev Mobile:<br />
• examples that can be used in Pocket PC only.<br />
• examples containing a project that can be used in Pocket PC and that interacts with a project<br />
that can be used in PC.<br />
• examples that can be used in PC only.<br />
The features of some examples supplied with WinDev Mobile are as follows.<br />
Examples that can be used in Pocket PC only<br />
Pocket Animated<br />
Pocket Explorer<br />
Pocket Financial<br />
Functions<br />
This example explains how animated images can be created by WinDev<br />
Mobile.<br />
This example is a file explorer for Windows CE. You have the ability to list<br />
the files and directories found on a Pocket PC.<br />
This examples explains how to use the financial functions.<br />
Pocket Inventory<br />
Pocket Loan Lite<br />
Pocket Map<br />
Pocket MIME<br />
Extraction<br />
Pocket Notes<br />
This example is used to draw up an inventory and to save the results in a<br />
Hyper File database.<br />
This example is used to simulate loans and to view their depreciation<br />
schedules.<br />
This example is a light version of WDMap. This example is used to view<br />
and modify the data files in Hyper File Mobile format directly on a Pocket<br />
PC.<br />
This example is used to extract the attachments from an email.<br />
This example is used to draw graphic "notes" and to save them. You have<br />
the ability to enter keywords to identify your notes.<br />
Part 6: Appendices
88<br />
Pocket Password<br />
Pocket Persistence<br />
Pocket Registered<br />
Pocket Regular<br />
Expressions<br />
Pocket Slides<br />
Pocket Statistics<br />
Pocket Thread Pool<br />
Pocket Tic Tac Toe<br />
This example presents a "box" of passwords. It can be used to manage<br />
the passwords created when using Internet sites but also in applications<br />
or in everyday’s life.<br />
This example presents the use of the functions for managing persistent<br />
values.<br />
This example is an attendance manager, used to check a meeting<br />
attendance.<br />
This database was previously filled with the list of members. A bar code<br />
reader can be used to read the identifiers of the persons.<br />
This example explains how to use the regular expressions and how to<br />
perform searches in character strings.<br />
This example is an image viewer for Pocket PC. It is used to view the<br />
images found in a given directory.<br />
This example performs statistical calculations.<br />
This example explains how to use threads.<br />
Reminder: A thread is a process run in parallel of the current application.<br />
This example is used to play at "Tic Tac Toe" on a Pocket PC.<br />
The purpose of this game is simple: align 3 dots before your opponent<br />
does.<br />
Pocket<br />
Keyboard<br />
Pocket ZIP<br />
Virtual<br />
This example proposes virtual keyboards that can be fully customized<br />
and certainly smaller than the standard keyboard of Pocket PCs.<br />
This example explains how to create and handle archives (".ZIP" files).<br />
Examples containing a project that can be used in Pocket PC and that interacts<br />
with a project that can be used in PC<br />
Part 6: Appendices<br />
Beach Booking<br />
•"Pocket Beach" project for Pocket PC<br />
•"PC Beach" project for PC<br />
Network Tasks<br />
•"Pocket NetworkTasks" project for<br />
Pocket PC<br />
•"PC Network Tasks" project for PC<br />
These examples are used to manage bookings for<br />
private beaches.<br />
You have he ability to synchronize the data entered<br />
in the two projects.<br />
The ’PC Network Tasks’ application is used to enter<br />
a task list (with management of priorities, deadline,<br />
automatic reminder, and so on).<br />
The ’Pocket Network Tasks’ application is used to<br />
access this task list to specify that a task is in<br />
progress or <strong>com</strong>pleted.
89<br />
Sending SMS<br />
• "Pocket Sending SMS" project for<br />
Pocket PC<br />
• "PC Sending SMS" project for PC<br />
Using sockets<br />
• "Pocket Using sockets" project for<br />
Pocket PC<br />
•"PC Using sockets" project for PC<br />
These examples are used to send SMSs.<br />
These examples present the use of the functions<br />
for socket management.<br />
Additional examples can be downloaded from our site (<strong>www</strong>.<strong>windev</strong>.<strong>com</strong>).<br />
Part 6: Appendices
90<br />
Part 6: Appendices