Samsung Electronics logo

Receiving Notifications on Application List Changes



Learning to receive notifications when the list of installed applications changes allows you to manage all the device applications from your application:

  1. Define the event handlers for different notifications using the ApplicationInformationEventCallback listener interface:

    var appEventCB = 
    { 
       /* When new applications are installed */
       oninstalled: function(application) 
       { 
          console.log("Application " + application.name + " installed"); 
       } 
    
       /* When applications are updated */
       onupdated: function(application) 
       { 
          console.log("Application " + application.name + " updated"); 
       } 
    
       /* When applications are uninstalled */
       onuninstalled: function(appid) 
       { 
          console.log("Application " + appid + " uninstalled"); 
       } 
    } 
  2. Register the listener to use the defined event handlers:

    var listenerID = webapis.application.addAppInfoEventListener(appEventCB);
  3. To stop the notifications, use the removeAppInfoEventListener() method of the ApplicationManager interface:

    webapis.application.removeAppInfoEventListener(listenerID);