Samsung Electronics logo

Launching Applications with the Application Control



Learning to use the application controls to launch applications allows you to take advantage of all the device applications from your application:

  1. To use the application control to pick image files from a list of images, create an ApplicationControl object.

    Define the desired functionality required from the application to be launched. The application needs to have an operation type suitable for selecting images, with URI as null, and the MIME type as image/*.

    var appControl = new webapis.ApplicationControl("http://samsungapps.com/appcontrol/operation/pick", null, "image/*");
  2. Define the format of the reply you want to receive from the application control:
    var appControlReplyCB = 
    { 
       /* Reply is sent if the requested operation is successfully delivered */
       onsuccess: function(reply) 
       { 
          for (var num = 0; num < reply.data.length; num++) 
          { 
             console.log("reply.data["+num+"].key = "+ reply.data[num].key); 
             console.log("reply.data["+num+"].value = "+ reply.data[num].value); 
          }
       } 
    }
  3. Call the launchAppControl() method to find a suitable application to select the images:
    webapis.application.launchAppControl(appControl, null,
                                    function(){console.log("launch appControl succeeded");}, 
                                    function(e){console.log("launch appControl failed. Reason: " + e.name);}, 
                                    appControlReplyCB);