Run sample app
Congratulations! You have now implemented the Knox SDK into an 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:
- On an Android Virtual Device (AVD)
- 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.
- Plug your Samsung device into your computer.
- On your device, navigate to Settings > About device, then tap Build Number seven times to enable developer options.
- Tap Settings > Developer options > USB debugging to turn USB debugging on.
- In Android Studio, with your project open, click Run > Run ‘app’ (or Shift + F10).
- Under Connected Devices, choose your test device.
Use the app
- When the app launches, tap ACTIVATE ADMIN
- In the pop-up prompt, tap Activate.
- Tap ACTIVATE LICENSE. Agree to the Samsung Knox EULA.
- Tap ACTIVATE BACKWARDS COMPATIBLE KEY if needed.
- Tap TOGGLE CAMERA.
- Now that you have disabled the camera, try launching it on your device. You should see the message “Security policy prevents use of Camera.” appear on the bottom of the screen.
- To re-enable the Camera, tap TOGGLE CAMERA again.
Uninstall the app
To uninstall an app with device administrator status, you must first deactivate its device admin privileges.
To deactivate device administrator for the app:
- Tap DEACTIVATE ADMIN.
- The app can now be uninstalled normally.
Tutorial progress
Congratulations! You’ve completed the tutorial.
On this page
Is this page helpful?