Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Use the ASP.NET Device Profiling Tool to Create BlackBerry device profiles

by BlackBerry Development Advisor ‎02-17-2010 09:49 AM - edited ‎09-20-2010 05:17 PM (3,251 Views)

Summary

This article applies to the following:

  • BlackBerry® Browser
  • BlackBerry Device Simulators 4.1.0 for BlackBerry 8700 Series of wireless handhelds
  • Microsoft® .Net Framework 1.1
  • Microsoft .NET Mobile Controls
  • Microsoft ASP.NET Device Profiling Tool

 


Procedure

Profiling BlackBerry devices for Microsoft .NET Mobile Controls

This article explains the process of creating a profile to allow BlackBerry devices to work with the Microsoft .NET Mobile Controls framework.

The Microsoft ASP.NET Device Profiling Tool is used to perform a series of tests with a BlackBerry device in order to create a profile. This profile is used by the Mobile Controls framework to create Mobile Controls that work within the capabilities of the BlackBerry device.

How device profiling works

For information, see the Device Profiling Tool Instructions document.

Mobile Controls QuickStart

The ASP.NET Mobile Controls QuickStart is a series of samples and supporting commentaries designed to introduce you to ASP.NET mobile controls.

Before implementing Mobile Web development with ASP.NET, it is advised that you review the Roadmap for Mobile Web Development with ASP.NET document.

Microsoft ASP.NET Device Profiling tool

The ASP.NET Device Profiling tool was created so that device users can create device profiles as additional devices become available. By design, the Mobile Controls framework is extensible so that additional device support is not dependent on support from Microsoft.

See the Device Profiling Tool Instructions document for information on how to use the tool.

Note: To use the Device Profiling tool, you need to register with the ASP.NET community.

After you log in to the community, you have access to existing device profiles and have the ability to profile a new device. The device profile can be viewed, modified, or downloaded for use in web.config or machine.config files.

BlackBerry Java™ Development Environment Device Simulators can be used to do the profiling. The BlackBerry Mobile Data System™ (BlackBerry MDS™) Simulator allows you to use the BlackBerry Browser to perform the device profile tests. It may be easier to create new profiles for similar devices by modifying an existing profile. This is especially true for devices running the same BlackBerry Device Software versions, where only the screen sizes vary.

ASP.NET Mobile Control Device Profile for BlackBerry 8700 Wireless Handheld™ with BlackBerry Device Software 4.1

For a sample Device Profile of a BlackBerry 8700™, see the 8700_Device_Profile.zip file. The generated device configuration file has a regular expression in the <case> element that matches the HTTP_USER_AGENT string of the device, which allows the ASP.Net runtime to identify the device.

The entry defined for each particular browser is shown as a case section in the <browserCaps> section of the config file:

<case match="BlackBerry((?'model'\d+)/(?'version'((?'major'\d+).(?'minor'\d+).(?'extra'\d+))))">

 This will define an entry for a BlackBerry device and create variables for the model, version, version major, version minor, and extra text.

 

Using these variables and a <filter> construct allows a single BlackBerry definition to be created that permits variations between devices, which is defined in the following section.

Adding Filter Matches for device differences

Here are filters for the screen size and color capabilities for BlackBerry 6200, 7200, 7500, 7100, 7700, and 8700 Series wireless devices:

<filter match="62??" with="${model}">

<filter match="62??" with="${model}">
isColor = "false"
screenPixelsWidth = 160
screenPixelsHeight = 100
screenBitDepth = 1
</filter>
<filter match="72??" with="${model}">
isColor = "true"
screenPixelsWidth = 240
screenPixelsHeight = 160
screenBitDepth = 16
</filter>
<filter match="75??" with="${model}">
isColor = "true"
screenPixelsWidth = 240
screenPixelsHeight = 160
screenBitDepth = 16
</filter>
<filter match="71??" with="${model}">
isColor = "true"
screenPixelsWidth = 240
screenPixelsHeight = 260
screenBitDepth = 16
</filter>
<filter match="77??" with="${model}">
isColor = "true"
screenPixelsWidth = 240
screenPixelsHeight = 240
screenBitDepth = 16
</filter>
<filter match="87??" with="${model}">
isColor = "true"
screenPixelsWidth = 320
screenPixelsHeight = 240
screenBitDepth = 16
</filter>

Profiling a new device

To profile a new device, go to the URL that is used to select the Device Headers for the device.

According to the device content-type header, the parameter to the ct variable is one of the following:

  • 0 is the application/xhtml+xml (default)
  • 1 is the text/html
  • 2 is the application/vnd.wap.xhtml+xml

To display the content type and the sections that contain the profile tests to be performed using the BlackBerry Browser and content-type 2, go to the http://www.asp.net/Mobile/Profile/xhtmlbasicmenu.aspx?ct=<0,1,2> URL using a BlackBerry 8700 Device Simulator.

BlackBerry Wireless Handheld Preferred Settings

When creating a profile, it is useful to know the preferred settings for the BlackBerry 8700 series handhelds. The following are preferred settings:

  • preferredImageMime is "image/jpeg"
  • preferredRenderingMime is "text/hmtl"
  • preferredRenderingType is "xhtml-mp"

BlackBerry 8700 Series Settings

The device profile defines the capabilities of the device, but the user can configure several items at the device level. Changing settings on the device can alter the behaviour of the Mobile Control when changed from the default, so care should be taken in reviewing the user experience. This is particularly true for JavaScript. The BlackBerry Browser applies the device settings when processing the browser content. For example, if table support is defined at the profile level but is disabled by the user at the device level, the table would not render correctly.

The following are device-level settings:

  • javascript is support JavaScript option
  • screenCharactersHeight is Font size option
  • screenCharactersWidth is Font size option
  • supportsCss is Support Style Sheets option
  • supportsBodyColor is Use Foreground and Background Colors option
  • supportsFontColor is Use Foreground and Background Colors option
  • tables is support HTML Tables option

BlackBerry Device Mobile Profile

A program that displays the HTTP headers from a BlackBerry Browser request can be used to get the values in the request header in order to obtain the BlackBerry device profile.


DB-00520_2.jpg





Download the device profile

If you access the http://www.blackberry.net/go/mobile/profiles/uaprof/8700/4.1.0.rdf profile URL from your personal computer, you will see the BlackBerry Device definition, which may be useful to understand the device capabilities and aid in completing a profile using the ASP.NET Device Profiling Tool.

If you use the same URL format, similar BlackBerry profiles exist for other devices, such as:

  • 8700 for the device
  • 4.1.0 is for the device software version

A sample of the device profile for the BlackBerry 8700 and BlackBerry Device Software 4.0 is as follows:

<prf:Keyboard>Qwerty</prf:Keyboard>
<prf:Model>BlackBerry 8700</prf:Model>
<prf:ScreenSize>320x240</prf:ScreenSize>
<prf:ScreenSizeChar>32x16</prf:ScreenSizeChar>

Using Mobile Capabilities item

The Mobile QuickStart samples contain a number of test programs that are useful for testing the device profile with requests from the device browser.

Once the samples are presented, find the Using Mobile Capabilities item, and select it to begin testing the specific values set in the Machine.config file for the devices that you have profiled.

Verify the entries specific to the device. For example:

DB-00520_3.jpg





DB-00520_4.jpg





DB-00520_5.jpg





DB-00520_6.jpgDB-00520_7.jpg











DB-00520_8.jpg

 

Contributors
Users Online
Currently online: 21 members 956 guests
Please welcome our newest community members: