Entering content frame

Process documentation Device Recognition Locate the document in its SAP Library structure

Purpose

The device recognition mechanism is part of the device-specific development of Web applications. It ascertains the device type from the HTTP query.

Prerequisites

You are using a Java-enabled Web server and have installed a Java Servlet Engine on your Web server. In addition, you have adapted the configuration for an enterprise-specific deployment.

Process Flow

Identifying a mobile device

The process of device recognition is based on the HTTP request headers "Accept" and "userAgent", which are sent to the server in the HTTP request by the requesting device. They enable the application to access the special capabilities of the requesting device through the implementation of the ClientInfo interface.

The device recognition mechanism compares the character sequence in the "userAgent" HTTP request header – for example, Nokia7110/1.0 (04.84), (information needed to identify the device) – with the values of the device properties in the devices.xml configuration file.

If it finds this character sequence in the file, the associated values can be accessed using the ClientInfo interface.

When evaluating the HTTP request header, the exactness with which the device is identified is taken into account. To do this, a specific priority value is assigned to each device type in the XML <priority/> tag in the configuration table.

If the priority value = 1, the character sequence matches exactly and a specific device type has been ascertained. If it cannot find a match when comparing the sequence, the device recognition mechanism tries to assign the device to a superordinate device type of priority 2 or 3.

For example, if the HTTP request "userAgent" contains a sequence beginning with "Nokia", the device type is recognized as a Nokia device and is assigned the values of a NokiaGeneric device type. The mechanism can invoke this generic device type, since developers can generally assume that a manufacturer will use the same browser for all devices.

If the device recognition mechanism cannot find any match in the configuration table, it can assign one of two types to the device, based on the value in the HTTP request header "Accept": Either the wmlGeneric type for WAP-enabled devices or the htmlGeneric type for HTML-enabled mobile devices. In this way, the device recognition mechanism can identify a mobile device even if there is no entry for it in the devices.xml configuration file.

How exactly the ClientInfo interface provides the specific values of the properties of a device is dealt with in The ClientInfo Interface in the Java Servlet Engine.

Result

The device recognition process ascertains the type of the device and provides a set of properties specific to the mobile device making the request.

 

 

Leaving content frame