NOTE - As of Knox 3.0, the preferred way to call Knox APIs is to upgrade an Android Work Profile to a Knox Workspace. This tutorial uses Android's Device Manager to call Knox APIs. See Upgrade Android Work Profile to Knox Workspace for more information.

Run the Sample app

Congratulations! You have now finished implementing the (Undefined variable: Variables.KnoxSDK) into an app. This section covers how to compile and run the app. This section covers how to compile and run the app.

Compile the app

Android Studio provides two ways to compile and test your app:

  1. On an Android Virtual Device (AVD).
  2. On a physical Samsung device.

The Knox SDK must be tested on a physical Knox supported device, as the Android studio emulator does not support Knox features.

  1. Plug your Samsung device into your computer.
  2. Enable developer options on your device by clicking Settings > About device > Tap Build Number seven times.
  3. Turn on USB debugging on your device by clicking Settings > Developer options > USB debugging.
  4. In Android studio, with your project open, click Run > Run 'app' (or Shift + F10).
  5. Choose the device you want to load and test on under Connected Devices.

Use the app

  1. When the app launches, tap ACTIVATE ADMIN
  2. In the pop-up prompt, tap Activate.
  3. Tap ACTIVATE LICENSE. Agree to the Samsung Knox EULA.
  5. Now that you have disabled the camera, try to open it on your device. It display the message "Security policy prevents use of Camera."
  6. To re-enable the Camera, re-tap TOGGLE CAMERA.

Uninstall the app

To uninstall an app with device administrator status, you must first disable the app using the security settings screen.

To deactivate device administrator for the app:

  1. Select Settings > General > Security > Device Administrators, then tap the app you want to deactivate.
  2. The app can now be uninstalled normally.

Tutorial Progress

You are done the tutorial. Congratulations!