Ben Malavazi
Oct 10, 2017
10:30 pm

Knox SDK integration on Android

I'm looking for documentation on how to integrate the Knox Standard SDK into an Android project. The instructions I've found list getting the license key, adding the broadcast receiver, and adding permissions. But there is no mention of what files need to be copied, any gradle build file changes, and/or any programmatic initialization necessary. Is there a detailed step-by-step account of what I need to do to get the SDK integrated into my project on Android Studio with Gradle?

Samuel Goldwax
Oct 10, 2017
10:51 pm

Hi Ben,

Pretty much all you need to get started using the Knox APIs is adding the Knox jar files as dependencies to your project. You can download these files under the Develop section. Once they're added as dependencies/libraries, all the information you need in terms of admin activation, license activation, and API usage is in the tutorial, which it sounds like you've already found.

Let me know if you have any more questions!

Sam

Ben Malavazi
Oct 10, 2017
11:05 pm

Thanks for the response!

I assume the JAR files you're referring to are: edm.jar, license.jar, and rc.jar? Can you please confirm?

So, if that's the case I'll just follow the precedent in the sample apps, and hopefully I'll be able to utilize a few of the API's in short order. I'll return if I run into any further issues. If you could just confirm that all I need are those 3 aforementioned JAR's, then I'll be good to proceed.

Thanks, Ben

Comments

That's correct

Samuel GoldwaxOct 10, 2017 at 11:12 pm
Samuel Goldwax
Oct 12, 2017
12:06 am

What error code are you receiving? You can check the error code by having something like this in your receiver:

int errorCode = intent.getIntExtra(EnterpriseLicenseManager.EXTRA_LICENSE_ERROR_CODE, -1);

You might also find it helpful to look through some of our sample apps to see their implementation.

- Sam

Comments

The error code is 301: ERROR_INTERNAL

I've pretty much copied the implementation of the sample app that toggles the camera on/off. With the exception that I'm blindly activating the license in onCreate(). I'm not waiting to make an API call then activating if there is a SecurityException.

Ben MalavaziOct 12, 2017 at 12:12 am
Ben Malavazi
Oct 12, 2017
12:11 am

Hi,

I'm getting license activation failures when callingĀ EnterpriseLicenseManager.activateLicense. The EnterpriseLicenseManager.EXTRA_LICENSE_STATUS extra is returning "fail". The broadcast receiver is being called, so I think that things are set up correctly. Could I be missing something?

I'm using the Knox Standard SDK Key: Enterprise License Key (Development). I uploaded my APK to get the hash extracted, and I'm running the same APK now.

The error code is 301: ERROR_INTERNAL

Ben Malavazi
Oct 12, 2017
1:29 am

The API I was using doesn't work:

activateLicense(LicenseKey) - FAILS

activateLicense(LicenseKey, PackageName) - WORKS