C H A P T E R  7

Device Definition Files

This chapter describes how to create device definition files that you can use to import devices to the Catalog Manager. See “Importing Devices” in the Catalog Manager online help for information on how to import devices.


Creating a Device Definition File

You can add devices into the Catalog Manager by importing device definition files in .xml format. Use the following tags to create a device definition file that you can use to import a device into the Catalog Manager. All required tags are noted.


TABLE 7-1 Device Definition Tags

Tag Name

Tag Description

<?xml?>

<?xml version="1.0" encoding="utf-8"?>

It is the first tag in the file. It states the XML version and the text encoding used for this file. The file must use UTF-8 encoding.

<Handset>

This tag is required.

This is the top-level content submission file tag and encloses the entire document.

<Name>

This tag is required.

Name of the device.

For example: MyPhone-829i

<Model>

This tag is required.

Model number of the device.

For example: 829i

<Manufacturer>

This tag is required.

Maker of the device.

For example: MyPhone

<Description>

This tag is required.

Information about the phone.

For example: Model supports Midp2.0

<UserAgentPattern>

This tag is required.

A unique identifier for a mobile device model. The user-agent is a regular expression that usually contains hardware, browser, and model information about the device.

For example: MP-829i/2\.0 MMP/2\.0

<MimeTypes>

The MimeTypes section of the device definition file must begin with this top-level MimeTypes tag.

Note: While you do not have to specify MimeType information, you must include the <MimeTypes/> tag in the device definition file.

The following tag is valid within <MimeTypes>: <MimeType>.

<MimeType>

This tag contains the information for a specific MimeType supported by the device. More than one MimeType tag can be included per device.

The following tags are valid within <MimeTypes>: <MimeName>, <MimeContentType>, <Extension>, <DeliveryType>, and <IsMMSCapable>.

<MimeName>

The name that identifies this MimeType.

For example: audio/midi

<MimeContentType>

The content type associated with this MimeType.

For example: ringtone

<Extension>

The file extension associated with this MimeType. Specify only one extension per MimeType.

For example: .mid

<DeliveryType>

The delivery method that the device supports, either one-step or two-step download, for that MIME type.

One-step download occurs when all information associated with the content is downloaded in a single step. One-step download is valid for any content type other than MIDlets.

Two-step download occurs when a descriptor file is associated with the content. First the descriptor file is downloaded, then the content is downloaded. MIDlets always use two-step downloads.

If you choose a two step download for content other than MIDlets, you must specify a content descriptor template when you set the capabilities of the device. See “Managing Content Descriptor Templates” in the Catalog Manager online help for more information.

For SMS content, you must choose either NSM or EMS as the delivery mechanism.

The following are valid values:

  • OTA one step = 1
  • OTA two-step = 2
  • NSM =3
  • EMS = 4

Note that only one SMS delivery mechanism type, either NSM or EMS, is allowed per device definition file.

<IsMMSCapable>

Whether or not the MIME type selected supports MMS.

Valid values are yes or no.

<Capabilities>

This tag is required.

The Capabilities section of the device definition file must begin with this top-level MimeTypes tag.

The following tag is valid within <Capabilities>: <Capability>.

<Capability>

This tag is required.

A device capability. Each device capability is defined with a separate <Capability> tag. See <Name> for a list of possible capability definitions. You must specify a browser type.

The following tags are valid within <Capability>: <Name> and <Value>.

<Name>

This tag is required.

The name of the device capability. Capabilities can include the following features:

  • bitsperpixel
  • browsertype (required)
  • ccppaccept-language
  • colorcapable
  • configuration
  • confirmcapable
  • descriptor-template
  • imagecapable
  • inputcharset
  • maxappsize
  • maxcntsize
  • numberofsoftkeys
  • outputcharset
  • profile
  • pushtype
  • screenheight
  • screenwidth
  • supportedlibs

You must specify a browser type, other capabilities can be specified as needed. See Chapter 8 Device Capabilities for descriptions and valid values.

<Value>

This tag is required.

The value of the capability being defined. You can use an asterisk (*) for any string or Boolean value. Using the asterisk indicates that the device supports any value.


The following code example demonstrates tag usage:


CODE EXAMPLE 7-1 Sample Device Definition File
<?xml version="1.0" encoding="UTF-8"?>
<Handset>
  <Name>MyPhone-829i</Name>
  <Model>829i</Model>
  <Manufacturer>MyPhone</Manufacturer>
  <Description>This is the latest MY series device.</Description>
  <UserAgentPattern>MP-829i/2\.0 MMP/2\.0</UserAgentPattern>
  <MimeTypes>
    <MimeType>
      <MimeName>audio/midi</MimeName>
      <MimeContentType>ringtone</MimeContentType>
      <Extension>.midi</Extension>
      <DeliveryType>1</DeliveryType>
      <IsMMSCapable>no</IsMMSCapable>
    </MimeType>
    <MimeTypes>
      <MimeType>
      <MimeName>audio/mp3</MimeName>
      <MimeContentType>ringtone</MimeContentType>
      <Extension>.mp3</Extension>
      <DeliveryType>1</DeliveryType>
      <IsMMSCapable>no</IsMMSCapable>
    </MimeType>
    <MimeType>
      <MimeName>audio/mp3</MimeName>
      <MimeContentType>ringtone</MimeContentType>
      <Extension>.mp3</Extension>
      <DeliveryType>1</DeliveryType>
      <IsMMSCapable>no</IsMMSCapable>
    </MimeType>
    <MimeType>
      <MimeName>image/jpeg</MimeName>
      <MimeContentType>image</MimeContentType>
      <Extension>.jpg</Extension>
      <DeliveryType>2</DeliveryType>
      <IsMMSCapable>no</IsMMSCapable>
    </MimeType>
    <MimeType>
      <MimeName>text/vnd.sun.j2me.app-descriptor</MimeName>
      <MimeContentType>midlet</MimeContentType>
      <Extension>.jad</Extension>
      <DeliveryType>2</DeliveryType>
      <IsMMSCapable>no</IsMMSCapable>
    </MimeType>
    <MimeType>
      <MimeName>application/java-archive</MimeName>
      <MimeContentType>midlet</MimeContentType>
      <Extension>.jad</Extension>
      <DeliveryType>2</DeliveryType>
      <IsMMSCapable>no</IsMMSCapable>
    </MimeType>
  </MimeTypes>
  <Capabilities> 
    <Capability>
      <Name>browsertype</Name>
      <Value>XHTML-UP</Value>
    </Capability>
    <Capability>
      <Name>colorcapable</Name>
      <Value>yes</Value>
    </Capability>
    <Capability>
      <Name>imagecapable</Name>
      <Value>yes</Value>
    </Capability> 
    <Capability>
      <Name>confirmcapable</Name>
      <Value>no</Value>
    </Capability>
    <Capability>
      <Name>bitsperpixel</Name>
      <Value>16</Value>
    </Capability>
    <Capability>
      <Name>inputcharset</Name>
      <Value>ISO-8859-1</Value>
    </Capability>
    <Capability>
      <Name>outputcharset</Name>
      <Value>US-ASCII, ISO-8859-1, UTF-8</Value>
    </Capability>
    <Capability>
      <Name>screenheight</Name>
      <Value>160</Value>
    </Capability>
    <Capability>
      <Name>screenwidth</Name>
      <Value>128</Value>
    </Capability>
    <Capability>
      <Name>pushtype</Name>
      <Value>sms</Value>
    </Capability>
    <Capability>
      <Name>ccppaccept-language</Name>
      <Value>en_US</Value>
    </Capability>
    <Capability>
      <Name>numberofsoftkeys</Name>
      <Value>2</Value>
    </Capability>
    <Capability>
      <Name>maxappsize</Name>
      <Value>*</Value>
    </Capability>
    <Capability>
      <Name>maxcntsize</Name>
      <Value>*</Value>
    </Capability>
    <Capability>
      <Name>descriptor-template</Name>
      <Value>template_pathname</Value>
    </Capability>
    <Capability>
      <Name>supportedlibs</Name>
      <Value>MIDP-2.0</Value>
    </Capability>
    <Capability>
      <Name>configuration</Name>
      <Value>CLDC-1.0</Value>
    </Capability>
    <Capability>
      <Name>profile</Name>
      <Value>MIDP-2.0</Value>
    </Capability>
  </Capabilities>
</Handset>