Samsung Electronics logo

Managing Applications



Learning how to launch and stop other applications, and hide or exit applications running on the device, allows you to manage all the device applications from your application:

  1. To launch or stop another application, you need the application ID (for launching) or context ID (for stopping) to identify the application.

    To launch an application, use the launch() method of the ApplicationManager interface, and to stop an application, use the kill() method.

    In the following example, the application to be launched and stopped is an alarm, with the samplealarm ID.

    /* Launch the application */
    webapis.application.launch("samplealarm", onsuccess);
    
    /* Stop the application */
    var appcontext = webapis.application.getAppsContext();
    for (int i; i < appcontext.length; i++) 
    {
       if (appcontext[i].id == "samplealarm") 
       {
          webapis.application.kill(appcontext[i].id, onsuccess); 
       }
    }
    

    You can also launch an application using the application control.

  2. To retrieve the current application, use the getCurrentApplication() method:

    var currApp = webapis.application.getCurrentApplication();
  3. To hide the current application, use the hide() method:

    currApp.hide();
    
  4. To exit the current application, use the exit() method:

    currApp.exit();