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 config.xml file
    <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
  • Operation
    http://tizen.org/appcontol/operation/default
  • 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
    var appid = "tizen.wearablemanager",
        extra_data = [new tizen.ApplicationControlData("type", ["launch-remote-browser"])],
        launch_uri = "https://www.tizen.org",
        appControlReplyCallback = {
            onsuccess: function(data) {
                for (var i = 0; i < data.length; i++) {
                    if (data[i].key == "error") {
                        console.log("error: " + data[i].value[0]);
                    }
                }
            }
        };
    
        var appControl = new tizen.ApplicationControl(
                "http://tizen.org/appcontrol/operation/default",
                launch_uri, null, null, extra_data
            );
    
        try {
            tizen.application.launchAppControl(appControl, appid,
                    function () {console.log("success");},
                    function(e) {console.log("failed : " + e.message);},
                    appControlReplyCallback);
        } catch(e) {
            console.log("Error Exception, error name : " + e.name + ", error message : " + e.message);
        }
    

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 config.xml file
    <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
  • Operation
    http://tizen.org/appcontol/operation/default
  • 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
    var appid = "tizen.wearablemanager",
        extra_data = [new tizen.ApplicationControlData("type", ["vendor"])],
        appControlReplyCallback = {
            onsuccess: function(data) {
                for (var i = 0; i < data.length; i++) {
                    if (data[i].key == "vendor") {
                        console.log("vendor : " + data[i].value[0]);
                    }
                }
            }
        };
    
        var appControl = new tizen.ApplicationControl(
                "http://tizen.org/appcontrol/operation/default",
                null, null, null, extra_data
            );
    
        try {
            tizen.application.launchAppControl(appControl, appid,
                    function () {console.log("success");},
                    function(e) {console.log("failed : " + e.message);},
                    appControlReplyCallback);
        } catch(e) {
            console.log("Error Exception, error name : " + e.name + ", error message : " + e.message);
        }
    

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 config.xml file
    <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
  • Operation
    http://samsung.com/appcontrol/operation/galaxy_apps/rate_app
  • Example Code
        var appControl = new tizen.ApplicationControl(
                "http://samsung.com/appcontrol/operation/galaxy_apps/rate_app");
    
        try {
            tizen.application.launchAppControl(appControl, null,
                    function () {console.log("success");},
                    function(e) {console.log("failed : " + e.message);});
        } catch(e) {
            console.log("Error Exception, error name : " + e.name + ", error message : " + e.message);
        }
    
Go to top