Back to top

Tutorial - Set up the Knox SDK

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.

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

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.

    Create Team Project dialog box

  4. Select Phone and Tablet as your platform.

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

    TargetAndroid.png

  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.

    Activity_blank.png

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

    EmptyAct.png

Now that you have set up your project, you can finish setting up the Knox SDK with the steps below.

The Knox SDK includes a JAR library file called knoxsdk.jar. You add this library to your Android Studio project if you want to enable your app to manage devices using the Knox SDK.

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

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

  3. Select knoxsdk.jar and copy it.

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

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

  6. The libraries appear in your project under the libs directory:

  7. Select the library, right-click and select Add As Library….

  8. 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!

Next

Is this page helpful?