Menu

App installation

Install an app

You can easily push an app onto a device or inside the Workspace container.

  1. Create the EnterpriseDeviceManager object.
  2. Create getApplicationPolicy
  3. Call installApplication and pass in your package name.
//Create EnterpriseDeviceManager
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);

//Create app policy
ApplicationPolicy appPolicy = edm.getApplicationPolicy();

//Install package
appPolicy.installApplication("com.sample.packagename");

Add app package name to blocklist

You can also add an application package name to blocklist, so that an application with a matching application package name cannot be installed.

  1. Create the EnterpriseDeviceManager object.
  2. Create getApplicationPolicy
  3. Call addAppPackageNameToBlackList and pass in your package name.
//Create EnterpriseDeviceManager
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);

//Create app policy
ApplicationPolicy appPolicy = edm.getApplicationPolicy();

//block any app package name
appPolicy.addAppPackageNameToBlackList("com.sample.packagename");

Create a Knox Workspace with pre-installed custom apps

The following examples create a Knox container that is pre-populated with custom apps. It also adds some extra security features.

  • Sets the container with a lock timeout of thirty minutes.
  • selects the authentication method of fingerprint.
  • installs three apps into the container: Email, Calendar, Contacts.

To create a Knox Workspace with pre-installed custom apps, do the following.

  1. Create a Knox Container.
  2. Update the app installation list with email, calender and contacts.
  3. Set the maximum inactivity time before the Knox container locks to 30 seconds.
    1. Set the password quality to the minimum quality allowed. Meaning when it is set to fingerprint quality, users can’t select a quality level less than this minimum setting; however users can select both PIN and Password.
  4. Add the customized configuration to the configuration list.
    • Use the unique name of above configuration to create container.
//Create a Knox container by cloning
KnoxConfigurationType defaultConfig = KnoxContainerManager.getConfigurationTypeByName("knox-b2b");
KnoxConfigurationType newConfig = defaultConfig.clone("custom4");

//Add apps
List<String> appList = new ArrayList<String> ();
appList.add("com.android.email");
appList.add("com.android.calendar");
appList.add("com.android.contacts");
newConfig.setAppInstallationList(appList)

//Set maximum lock time
newConfig.setMaximumTimeToLock(30 * 60 * 1000);

//Set password quality to fingerprint
newConfig.setPasswordQuality(BasePasswordPolicy.PASSWORD_QUALITY_FINGERPRINT);

//Apply configurations to cloned container
KnoxContainerManager.addConfigurationType(this, newConfig);
KnoxContainerManager.createContainer("custom4");