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
Open Android Studio and create a new project.
- Click File > New Project.
Fill out the fields:
- Application name — your app name.
- Company domain — the qualifier for your app package name.
- 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.
- Project Location — the directory where your app is stored. You can use the default or specify another location, if desired.
Select Phone and Tablet as your platform.
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.
Select your activity type and click Next. For the purpose of this tutorial, select Empty Activity. For more information on Activities, see Android Activities.
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 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
Open the project in Android Studio.
Use a file browser to navigate to the location that the library files are stored.
knoxsdk.jarand copy it.
- If you need to target lower than API level 26, you must also use the add-on support library jar.
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.
A copy dialog appears. Click OK to complete copying the libraries into the project.
The libraries appear in your project under the libs directory:
Select the library, right-click and select Add As Library….
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.
You are 3/10 done!Next
Is this page helpful?
Thank you for your feedback!