Menu
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.

Set up the Knox SDK

The following instructions describe how to set up the Knox SDK. You must do this before you can use any of the Knox APIs on your Samsung device.

Download the Knox SDK

  1. Sign in to your Knox Partner Portal.
    • If you're not already a member of the Knox Partner Portal, click Become a Partner and provide your details.
  2. On your personal dashboard, click SDKs & toolsSDKs download.
  3. On the SDKs download page, browse the Release Notes for different SDK versions. Click Download for the SDK you want.
  4. Review the SDK Agreement. If you agree to the terms, select the checkbox and click Accept. The browser saves the SDK package into your downloads folder.
  5. Extract the SDK .zip contents.
  6. Copy the extracted addon_xxx folder to your IDE's add-ons folder. For:
    • Tizen Studio—tizen-studio\ide\plugins

Create your Android Project

  1. Open Android studio and create a new project.
    1. Click File > New Project
  2. Fill out the fields:
    1. Application name: your app name.
    2. Company domain: the qualifier for your app package name.
    3. Package name: this is the combination of the company domain and application name, which must be unique across all packages in the Android environment. Android generates this from the application name and company domain values.
    4. Project Location: the directory where your app is stored. You can use the default or specify another location, if desired.
  3. Click Next.
  1. Select Phone and Tablet as your platform.
  2. Select the API level you want to target. API level 26 is the minimum you must target to utilize the full features of the Knox SDK. See Knox version mapping for more information. If you need to target lower than 26, you must use the add-on support library jar.

6. Select your activity type and click Next. For the purpose of this tutorial, select Empty Activity. For more information on Activities, see Android Activities.

7. Choose an Activity Name and Layout Name. Click Finish. For the purpose of this tutorial, use the default values – MainActivity and activity_main.

Now that you have set up your project, you can finish setting up the (Undefined variable: Variables.KnoxSDK) with the steps below.

Note: The (Undefined variable: Variables.KnoxSDK) includes a JAR library file called the knoxsdk.jar. You add this library to your Android Studio project if you want to enable your app to manage devices using the (Undefined variable: Variables.KnoxSDK)

For more information on creating a project in Android, see Google's page on how to Create an Android project.

Adding Knox SDK libraries to a project

  1. Open the project in Android Studio.

  2. Use a file browser to navigate to the location that the library files are stored.

  1. Select theknoxsdk.jar and copy it.
  1. Switch to your Android Studio project, select the libs directory, and paste the libraries into your project. If you do not see the libs directory, ensure your file browser is using 'Project' view rather than 'Android' view. You may have to create this folder yourself

  1. A copy dialog appears. Click OK to complete copying the libraries into the project.

  1. The libraries appear in your project under the libs directory:
  1. Select the library, right-click and select Add As Library...
  2. Select the module to add the library to, and click OK. If your app contains several modules, you must ensure that you add the library to the appropriate module. For the purpose of this tutorial, select the app module.

Your project now includes the Knox SDK.

Tutorial Progress

You are 3/10 done! Go to the next step.