Wearable Web

Application Controls

Application Controls provides functions for launching other applications with a specific operation, URI, MIME type, and extra data. The requesting application can get a result back from the launched application. This topic introduces the Application Control of Galaxy Watch.

Launching the browser of the remote device

Use the Application Controls to launch the browser with the verification.

  • To use the Application Controls API, the application has to request permission by adding the following privileges to the tizen-manifest.xml file
    <privileges>
        <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
    </privileges>
  • Include the <app_control.h> header file in your code.
    #include <app_control.h>
  • Operation
    http://tizen.org/appcontol/operation/default (in .c files and manifest file)
    APP_CONTROL_OPERATION_DEFAULT (in .c files only)
  • App ID
    tizen.wearablemanager
  • Extra Data (Mandatory)
    Key   : "type"
    Value : "launch-remote-browser"
  • URI (Mandatory)
    http       : <path>
    https : <path>
    file : <path>
    javascript : <path>
  • Handling error strings on the reply callback
    Key   : "error"
    Value : "NONE", "NOT_CONNECTED"
  • Example Code
    static void reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
    {
        char *value = NULL;
        if (result == APP_CONTROL_RESULT_SUCCEEDED) {
            if (app_control_get_extra_data(reply, "error", &value) == APP_CONTROL_ERROR_NONE)
                /* Handle reply */
        } else {
            /* Check the return result and handle */
        }
    }
    static void send_application_control()
    {
        app_control_h app_control;
        app_control_create(&app_control);
     
        app_control_set_app_id(app_control, "tizen.wearablemanager");
        app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
        app_control_add_extra_data(app_control, "type", "launch-remote-browser");
        app_control_set_uri(app_control, "https://www.tizen.org");
    
        app_control_send_launch_request(app_control, reply_cb, NULL);
        app_control_destroy(app_control);
    }
    

Retrieving the vendor information of the remote device

Use the Application Controls API to retrieve vendor information of the remote device.

  • To use the Application Controls API, the application has to request permission by adding the following privileges to the tizen-manifest.xml file
    <privileges>
        <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
    </privileges>
  • Include the <app_control.h> header file in your code.
    #include <app_control.h>
  • Operation
    http://tizen.org/appcontol/operation/default (in .c files and manifest file)
    APP_CONTROL_OPERATION_DEFAULT (in .c files only)
  • App ID
    tizen.wearablemanager
  • Extra Data (Mandatory)
    Key   : "type"
    Value : "vendor"
  • Get the result value on the reply callback
    Key   : "vendor"
    Value : [Vendor name of the remote device]
  • Example Code
    static void reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
    {
        char *value = NULL;
        if (result == APP_CONTROL_RESULT_SUCCEEDED) {
            if (app_control_get_extra_data(reply, "vendor", &value) == APP_CONTROL_ERROR_NONE)
                /* Handle reply */
        } else {
            /* Check the return result and handle */
        }
    }
    static void send_application_control()
    {
        app_control_h app_control;
        app_control_create(&app_control);
     
        app_control_set_app_id(app_control, "tizen.wearablemanager");
        app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
        app_control_add_extra_data(app_control, "type", "vendor");
     
        app_control_send_launch_request(app_control, reply_cb, NULL);
        app_control_destroy(app_control);
    }
    
    

Showing the rate app screen in Galaxy Apps

You can create Rate App screen using this app control operation.

  • To use the Application Controls API, the application has to request permission by adding the following privileges to the tizen-manifest.xml file
    <privileges>
        <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
    </privileges>
  • Include the <app_control.h> header file in your code.
    #include <app_control.h>
  • Operation
    http://samsung.com/appcontrol/operation/galaxy_apps/rate_app (in .c files and manifest file)
  • Example Code
    static void send_application_control()
    {
        app_control_h app_control;
        app_control_create(&app_control);
    
        app_control_set_operation(app_control, "http://samsung.com/appcontrol/operation/galaxy_apps/rate_app");
    
        app_control_send_launch_request(app_control, NULL, NULL);
        app_control_destroy(app_control);
    }
    
    
Go to top