Compiling a project

About compiling a project

ArcPad Studio supports compiling customization projects—default configurations (ArcPad.apx), layer definitions (.apl), and applets (.apa). The compilation process merges and validates associated customization files and script source code files into as few files as possible for rapid project deployment. For example, if an applet contains a custom toolbar with tool buttons that have user-defined images (.bmps) and an associated source code file (.vbs, .js, .py), the compile tool places these project components into a single file for deployment.

If files can be embedded into the compiled project, ArcPad Studio handles this and removes the references to the original files. You do not need to deploy the files that were embedded.

ArcPad Studio supports two types of file dependencies during compilation: automatic dependencies and user-defined dependencies.

Automatic dependencies

During the compile process, ArcPad Studio processes the project's ArcPad Extensible Markup Language (XML) file (.apx, .apl, or .apa) and identifies which files the project requires. Currently, ArcPad Studio can identify the following types of dependent files:

  • Scripts—Script files referenced by any scripting elements present, for example: <SCRIPT src="mysourcefile.vbs" language="VBScript" />.
  • Images—Any image files referenced by image="filename.bmp" in various elements that support the image attribute.
  • Tables—DBF tables used for list box and combo box controls in forms. These are referenced by listtable="filename.dbf" in <COMBOBOX> and <LISTBOX> elements.
  • Shapefiles—For layer definition projects, all components of the shapefile layer are identified (.prj, .shp, .shx, .dbf, .cpg, .sbn, .sbx).
    CautionCaution:

    ArcPad Studio cannot identify photos or other similar data that may be referenced in the shapefile's attributes.

If a dependent file can be embedded, ArcPad Studio reads the file and places its contents directly in the output project file. This is currently supported for Windows Bitmap images and script source code files. The major advantage of embedding files is that you can end up with a single deployable file if all the dependent files can be embedded.

Images that are not in Windows Bitmap format (for example, .ico files), DBF tables, and shapefile components are identified, but cannot be embedded in the project file. These files are copied to the project output folder and need to be deployed with the project.

User-defined dependencies

In more complex projects, additional files may be required that cannot be identified by ArcPad Studio's project compiler. For example, if the code references a DBF table directly rather than via a control in a form, or if you want to supply a readme or help file with an applet.

To handle these files, <DEPENDENCY> elements can be manually inserted into the project (.apx, .apa, or .apl) to specify that additional files are required for the project to run. See the following code example:

<ArcPad>
				...
    <DEPENDENCY file="codes.dbf"/>
    <DEPENDENCY file="ReadMe.txt"/>
</ArcPad>

Setting compile preferences

Compile preferences are saved in the My Documents folder of the ArcPadStudioPrefs.apx file.

Prerequisite:

To set compile preferences, complete the following steps:

Steps:
  1. Click the Tools menu and click Options.

    The Preferences dialog box appears.

  2. Click the Compile tab.
  3. Type the paths for the project output folders for each type of project (applet, configuration, and layer).
  4. Check Encode, Package, and Download, as necessary, for each type of project.

    • Encode encrypts the project files to protect source code.
    • Package compresses the project files into .zip format.
    • Download downloads the project files to a connected mobile device.
      NoteNote:

      If Download is checked for a project output folder and a mobile device is not connected via ActiveSync or Windows Mobile Device Center, a Please Connect Device message will be displayed.

Compiling the project

Steps:
  1. Create or open a project file.

    This can be a layer definition file (.apl), a default configuration file (.apx), or an applet file (.apa).

  2. Click the Compile button Compile.

Interpreting the compile output log file

When a project is compiled, ArcPad Studio displays a log file. The log file is also saved in the original project's folder, with a .log file extension. The log file is divided into multiple sections. The contents of these sections reflect the project type and options specified.

The following compile log example illustrates an applet project with the Encoding, Package, and Download options selected:

ArcPad Studio Build Log (sample)
================================================================================
Project Type : APPLET
Output Path : C:\Users\Public\Documents\ArcPad\Applets
Encode : Yes
Reformat : No
Input Project : C:\Users\Public\Documents\ArcPad\Samples\Redlands\Redlands Applet\Redlands.apa
Output : C:\Users\Public\Documents\ArcPad\Applets\Redlands.apa
Processing <SCRIPT> elements and event handlers
--------------------------------------------------------------------------------
Using default scripting language : 'VBScript'
Warning: Scripting language not specified in any <SCRIPT> elements, setting language="VBScript"/>
Checking scripts for <FORM> event handlers, language="VBScript"
'onload' script syntax ok
'onselchange' script syntax ok
'onselchange' script syntax ok
'onclick' script syntax ok
'onclick' script syntax ok
'onclick' script syntax ok
'onclick' script syntax ok
'onpointerup' script syntax ok
'onclick' script syntax ok
'onclick' script syntax ok
Found 1 <SCRIPT> element(s)12453 characters imbedded from C:\Users\Public\Documents\ArcPad\Samples\Redlands\Redlands Applet\Redlands.vbsProcessing images
--------------------------------------------------------------------------------
Found 3 element(s) with 'image' attributeImage 'tree.bmp' was imbedded
Image 'gpstree.bmp' was imbedded
Image 'sigma.bmp' was imbeddedProcessing <FORMS>
--------------------------------------------------------------------------------
Found 1 <FORMS> element(s)
Found 1 form(s)
<FORM name="Statistics"/>
Found 1 <PAGE> element(s)
<PAGE name="onlypage"/>
Found 24 control(s)
<COMBOBOX name="cmbLayer"/>
<LABEL name="slblLayer"/>
<LABEL name="slblField"/>
<COMBOBOX name="cmbField"/>
<LABEL name="slblCount"/>
<LABEL name="slblMinimum"/>
<LABEL name="slblMaximum"/>
<LABEL name="slblSum"/>
<LABEL name="slblMean"/>
<LABEL name="slblRange"/>
<LABEL name="slblVariance"/>
<LABEL name="slblSD"/>
<LABEL name="vlblCount"/>
<LABEL name="vlblMinimum"/>
<LABEL name="vlblMaximum"/>
<LABEL name="vlblSum"/>
<LABEL name="vlblMean"/>
<LABEL name="vlblRange"/>
<LABEL name="vlblVariance"/>
<LABEL name="vlblSD"/>
<BUTTON name="btnIdentifyMin"/>
<BUTTON name="btnIdentifyMax"/>
<BUTTON name="btnGoToMin"/>
<BUTTON name="btnGoToMax"/>
================================================================================
Compile completed with 1 warning(s)
--------------------------------------------------------------------------------
Found 0 <DEPENDENCY> elements
********************************************************************************
Packaging Project
--------------------------------------------------------------------------------
Package : C:\Users\Public\Documents\ArcPad\Applets\Redlands.zip Packaging : C:\Program Files\ArcPad 7.0\Applets\Redlands.apa1 file(s) packaged
********************************************************************************
Remote Device Update
--------------------------------------------------------------------------------
Remote path : \Program Files\ArcPad\Applets C:\Users\Public\Documents\ArcPad\Applets\Redlands.apa -> REMOTE:\Program Files\ArcPad\Applets\Redlands.apa : Copied 21358 bytes1 of 1 associated file(s) copied to remote device
================================================================================
Project Summary
--------------------------------------------------------------------------------
Project Type : APPLET
Output Path : C:\Users\Public\Documents\ArcPad\Applets
Encoded : Yes
Warnings : 1
Output Size : 21358 bytes (20.86 kb)
Package : C:\Users\Public\Documents\ArcPad\Applets\Redlands.zip
Package Size : 11396 bytes (11.13 kb)
Package Compression : 46.6%
--------------------------------------------------------------------------------
The following 1 file(s) are required for deployment of your project :
--------------------------------------------------------------------------------
C:\Users\Public\Documents\ArcPad\Applets\Redlands.apa
================================================================================

To open an existing log file, complete the following steps:

Steps:
  1. Click the File menu, and click Open.
  2. Browse to the log file's folder.
  3. Select Log Files (.log) to see the available log files in the folder.

Deploying a compiled project

Steps:
  1. If Download is checked for the project on the Compile tab of the Preferences dialog box, all project files are copied directly to the connected mobile device. No further action is required.
  2. If Download is not checked, manually copy all files in the project output folder to the desired project folder on the mobile device (for example, via ActiveSync's File Explorer).
TipTip:

If Package is checked for the project on the Compile tab of the Preferences dialog box, a .zip file containing all the required project files is created in the project output folder. This .zip file can be sent to any number of users for easy deployment onto their mobile devices.


2/7/2013