언어 설정

Menu
Sites
Language
Change settings programmatically (wearable)
Is it possible to change like always on mode, brightness setting etc programmatically?

Responses

3 댓글
Armaan-Ul- Islam

Here's a code to change brightness setting programmatically:

#include <device/display.h>
#include <dlog.h> // for logging purposes

static void brightnessFunction() {
    int brightness, maxBrightness;
    device_display_get_brightness(0, &brightness); //The index zero is always assigned to the main display. 
                                                   (For multiple display case)
    LOGI("Current main display brightness value: %d", brightness);

    device_display_get_max_brightness(0,&maxBrightness); //get Maximux Brightness 
    device_display_set_brightness (0,maxBrightness);     //set Brightness to max 
}

 

 **PRIVILEGE needed to be set in tizen-manifest.xml**

tizen-manifest.xml > Privileges Tab > Add

http://tizen.org/privilege/display

Link:

https://developer.tizen.org/development/api-references/native-application?redirect=/dev-guide/2.4/org.tizen.native.mobile.apireference/group__CAPI__SYSTEM__DEVICE__DISPLAY__MODULE.html

Tizen is me

Thanks, always on display setting cannot be changed programmatically ?

Armaan-Ul- Islam

I haven't seen any code yet to do that directly. The best way I know you can achieve is to launch the settings app to user and Request the user to change the setting according to application need.

 

To do that you can use Application Control

Sample Code:

#include <app.h>

app_control_h app_control;

if (app_control_create(&app_control)== APP_CONTROL_ERROR_NONE)
{
    if (app_control_set_app_id(app_control, "org.tizen.clocksetting") == APP_CONTROL_ERROR_NONE)
    {
        if(app_control_send_launch_request(app_control, NULL, NULL) == APP_CONTROL_ERROR_NONE)
        {
            LOGI("App launch request sent!");
        }
    }
    if (app_control_destroy(app_control) == APP_CONTROL_ERROR_NONE)
    {
        LOGI("App control destroyed.");
    }
}

 

appId of settings app:

org.tizen.clocksetting                    //Settings app on Emulator
com.samsung.clocksetting                 //Settings app on Samsung Device
com.samsung.clocksetting.brightness      //Brightness setting app on Samsung Device

You may check Application Control Guide for details implementation

 

Please mark this as 'best answer' to promote this post to others.