Handling the Rotating Bezel Feature

You can verify whether the device supports the rotating bezel feature.

The following table shows feature key for the rotating bezel:

Feature key Type Description Since
http://tizen.org/feature/input.rotating_bezel bool

Specify this key, if the application requires the rotating bezel input.

The platform returns true, if the device supports the rotating bezel feature.

2.3.1

Prerequisites

The Tizen platform supports three primary application types: Native application is developed using C language, Web application is essentially a Web site stored on your device and built using Web-native languages, such as HTML5, CSS, and JavaScript, and Tizen .NET application is a new way to develop applications using C# language. 

You request to use a header file by including it or namespace that is designed for providing a way to keep one set of names separate from another in your program depending on the type of applications.

Native Application

<system_info.h> contains function declarations and macro definitions for rotation events.

To use the functions and data types of the System Information API, include the <system_info.h> header file in your application:

#include <system_info.h>

Web Application

There is no prerequistes.

.NET Application

Tizen.System namespace provides the class and methods for roation events.

To use the methods and properties of the Tizen.System.Information class, include the Tizen.System namespace in your application:

using Tizen.System;

Retrieve the system information

Before using rotating bezel functionality, you can check whether the device support the feature.

Native Application

To verify whether the device has the rotating bezel, use the http://tizen.org/feature/input.rotating_bezel key with the data type-specific get function:

  • bezel key data type is bool, which means that you need to use the system_info_get_platform_bool() function:

    #include <stdbool.h>
    
    void
    func(void)
    {
        bool value;
        int ret;
    
        ret = system_info_get_platform_bool("http://tizen.org/feature/input.rotating_bezel", &value);
        if (ret != SYSTEM_INFO_ERROR_NONE) {
            /* Error handling */
    
            return;
        }
    
        dlog_print(DLOG_INFO, LOG_TAG, "Bezel: %s", value ? "Supported" : "Not supported");
    }
    

Web Application

Retrieve a device capability using the getCapability() method of the SystemInfo interface:

  • get a specific capability of the device, use the getCapability() method:

    var bezel = tizen.systeminfo.getCapability('http://tizen.org/feature/input.rotating_bezel'); 
    console.log(' Bezel = ' + bezel);
    

.NET Application

To retrieve system information, use the TryGetValue() method of the Tizen.System.Information class:

  • retrieve the rotating bezel feature:

    // Check whether the device has a rotating bezel
    public static bool is_rotating_bezel_device()
    {
        bool ret;
    
        if (Tizen.System.Information.TryGetValue<bool>("http://tizen.org/feature/input.rotating_bezel", out ret) == false)
        {
            // Error handling
        }
    
        return ret;
    }
    

 

For more information about rotating bezel, see on system information and features (in Native ApplicationWeb application, and .NET application.)

Application filtering

For application stores to correctly select your application for installation on an appropriate device, http://tizen.org/feature/input.rotating_bezel must be correctly declared in your application.

Native Application

To enable filtering for your native application, add the feature list for the application in the tizen-manifest.xml file:

  1. Open the manifest editor in the Tizen Studio and double-click on the tizen-manifest.xml file in the Project Explorer view.
  2. Select the features you need, one at a time:

    1. In the Features tab, click +.
    2. Select a feature.
    3. Click OK.

    The manifest file (tizen-manifest.xml) is updated automatically.

The following example shows the setting in the tizen-manifest.xml file code:

<manifest>
    <ui-application>
        ...
    </ui-application>
    <feature name="http://tizen.org/feature/input.rotating_bezel">true</feature>
    ...
</manifest>

.NET Application

To enable filtering for your .NET application, add the feature list for the application in the tizen-manifest.xml file:

  1. Open the manifest editor in the Visual Studio and double-click the tizen-manifest.xml file in the Solution Explorer view.
  2. Select the features you need, one at a time:

    1. In the Features tab, click Add.
    2. Select a feature.
    3. Click OK.

    The manifest file (tizen-manifest.xml) is updated automatically.

The following example shows the setting in the tizen-manifest.xml file code:

<manifest>
    ...
    <provides-appdefined-privileges />
    <feature name="http://tizen.org/feature/input.rotating_bezel">true</feature>
    ...
</manifest>

Web Application

To enable filtering for your Web application, add the feature list for the application in the config.xml file:

1. Open the Web application configuration editor in the Tizen Studio and double-click on the config.xml file in the Project Explorer view.

2. In the Features tab, click +.

3. Select the features you need.

4. Click OK.

After setting the feature information with the Web application configuration editor, you can see the added code in the Source tab.

The following example shows the setting in the config.xml file code:

<widget>
    <content src=c"index.html"/>
    <feature name="http://tizen.org/feature/screen.size.all"/> 
    ...    
    <feature name="tizen.org/feature/input.rotating_bezel"/>
    ...
</widget>

 

For more information about application filtering, see Application Filtering for Native or .NET application and Application Filtering for Web application.

List
SDK Version Since: 
2.4 mobile/2.3.1 wearable