The template files are used to define visual aspects of the mobile device screen, for example, the color of the heading row, and the color of a row when it is selected and when it is not. Template files contain a few strings that can be customized or localized, and settings for font type and size, and encoding.
Template files are provided for mobile device dimensions, orientation (portrait and landscape), and resolution. When you modify template files for a particular screen size and configuration, modify similar values in all files.
When modifying the template files, keep in mind the following guidelines:
You can edit any strings that are English
language strings, such as Application [Last
Downloaded]
in this property:
<Property Name="CellSource"
Value=""Application [Last Downloaded]"" />
Note that the "
XML
entities identify this as a human language value, which can be translated
and localized. Be sure to leave the XML entities intact [including
the ampersand (&
) and
semicolon (;
)],
otherwise the XML document will be invalid, causing the XML parser
to fail, and making the .NET client unable to load the templates.
Do not edit any variables, such as APPLICATION_NAME
in
this property:
<Property Name="CellSource"
Value="APPLICATION_NAME" />
APPLICATION_NAME
is
a special variable flag that is replaced by the name of the application.
If you edit this value, no application name will appear, even for
other languages.
Template values like APPLICATION_NAME
that
are not surrounded by the "
XML
entity should not be edited. They serve as variable flags that are
replaced by the client application when there is data to display
on the screen.
Do not modify any coordinate values, such as:
<Property Name="Location" Value="0,28" />
Templates should not be edited on the device. Instead, they should be transferred to the PC (which can be done using the ActiveSync File Explorer), and edited on a text editor that supports UTF-8. After editing the files, move them back to the device, and restart the application to see the changes.
As with the Strings.xml file, you may need to develop procedures for deploying updated template files to mobile device users. You may want to consider using a remote device management tool, such as Afaria, to place new images and files on PDAs.
For localization, you can edit the default template files to something other then English, or you can add multiple language support by creating copies of the templates using the same naming technique used for the Strings.xml file (described in “Customizing language”). For example, with a 240x320 device set to Belgian Dutch, the client would look for templates in this order:
Template.Applications.240x320.nl-BE.XML
Template.Applications.240x320.nl.XML
Template.Applications.240x320.XML
Customizing the device template files
Identify the dimensions of your mobile device screen, for example, 240 x 320 pixels.
Identify the templates available for the screen dimensions, for example:
Template.Applications.240x320
Template.ApplicationDataDetailView.240x320
Template.ApplicationDataListView.240x320
Template.ApplicationsSyncList.240x320
Template.DataEdit.240x320
Template.InsertDataForm.240x320
Template.InsertDataGrid.240x320
Template.LogsListView.240x320
Template.LogsDetailView.240x320
Template.ProfileManager.240x320
Template.ProfileEditor.240x320
On the mobile device, navigate to the template files.
Transfer the files to the PC (which can be done using the ActiveSync File Explorer).
Using a text editor that supports UTF-8, search each template for properties, and update the values for your environment. Keep in mind the guidelines provided above. Typical properties to customize include:
Font (or TextFont)
Colors (BackColor, ForeColor, AlternateForeGround, SelectionBackColor, ActiveColor, VisitedColor, GridColor, and so forth)
Encoding (such as UTF-8)
English language string values (such as the profile labels used when you set up a user profile, found in Template.ProfileEditor.240x320)
Save each file and close it.
Move the template files back to the device.
Restart the application to view the changes.