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?
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 :
- List applications using the service ApplicationsManager :
ApplicationsManager am = ServiceLoaderFactory.getServiceLoader().getService(ApplicationsManager.class);
if(am!=null){
Application[] apps = am.getInstalledApplications();
}
- Install an application using the service ApplicationsManager :
ApplicationsManager am = ServiceLoaderFactory.getServiceLoader().getService(ApplicationsManager.class);
if(am!=null){
Application myApp = am.install(inputStreamToMyApp, "MyApp", "1.0.0");
}
- Uninstall an application using the Application APIs :
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.
.