Programatically list, install and uninstall apps


#1

Is there a way to programatically list/install/uninstall an app. Is their an API call that returns all available apps installed? Is their an API call to install/uninstall an app?


#2

Hi John,

Application life-cycle is managed by the firmware kernel’s applications, so this will depends on the firmware. For our demo Firmware you can :

   ApplicationsManager am = ServiceLoaderFactory.getServiceLoader().getService(ApplicationsManager.class);
   if(am!=null){
         Application[] apps = am.getInstalledApplications();
   }
   ApplicationsManager am = ServiceLoaderFactory.getServiceLoader().getService(ApplicationsManager.class);
   if(am!=null){
         Application myApp = am.install(inputStreamToMyApp, "MyApp", "1.0.0"); 
   }
   Application myApp;
   myApp.uninstall();

N.B.

  • The installation of an application won’t start and show it (if any activity is available), to do so you can have a look at the utility class LauncherHelper.
  • An application cannot uninstall itself.
  • Those APIs are for firmware supporting Wadapps, for firmware without the Wadapps component you may have a look at the lowerlevel APIs of KF Kernel.

.