Package com.microblink.blinkid
Class MicroblinkSDK
java.lang.Object
com.microblink.blinkid.MicroblinkSDK
Entry class for all Microblink SDKs - used for setting up license key and to add support for
optimisation of passing data between activities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic android.content.Context
static IntentDataTransferMode
Returns current intent data transfer mode.static String
Methods returns the version string of native library, if it has been loaded.static void
setIntentDataTransferMode
(IntentDataTransferMode intentDataTransferMode) Sets intent data transfer mode for passing Microblink SDK data between activities.static void
setLicenseBuffer
(byte[] licenseBuffer, android.content.Context applicationContext) Set license buffer and unlock the SDK.static void
setLicenseBuffer
(byte[] licenseBuffer, String licensee, android.content.Context applicationContext) Set license buffer and unlock the SDK.static void
setLicenseFile
(String licenseFilePath, android.content.Context applicationContext) Set the license file and unlock the SDK.static void
setLicenseFile
(String licenseFilePath, String licensee, android.content.Context applicationContext) Set the license file and unlock the SDK.static void
setLicenseKey
(String base64LicenseKey, android.content.Context applicationContext) Set license key and unlock the SDK.static void
setLicenseKey
(String base64LicenseKey, String licensee, android.content.Context applicationContext) Set license key and unlock the SDK.static void
Set custom URL for Ping and licence check (used as a proxy).static void
setShowTrialLicenseWarning
(boolean showTrialLicenseWarning) Disable or enable showing of toast when trial license key is entered.
-
Method Details
-
getApplicationContext
@Nullable public static android.content.Context getApplicationContext() -
getIntentDataTransferMode
Returns current intent data transfer mode.- Returns:
- current intent data transfer mode.
- See Also:
-
setIntentDataTransferMode
public static void setIntentDataTransferMode(@NonNull IntentDataTransferMode intentDataTransferMode) Sets intent data transfer mode for passing Microblink SDK data between activities. By default,IntentDataTransferMode.PERSISTED_OPTIMISED
is used.- Parameters:
intentDataTransferMode
- requested data transfer mode- See Also:
-
setShowTrialLicenseWarning
public static void setShowTrialLicenseWarning(boolean showTrialLicenseWarning) Disable or enable showing of toast when trial license key is entered. By default, whenever someone uses trial license key, a toast will appear informing user that license is trial. This feature should protect you from accidentally using trial license key in production version of your app.- Parameters:
showTrialLicenseWarning
- whether or not warning for using trial license should be shown
-
getNativeLibraryVersionString
Methods returns the version string of native library, if it has been loaded. If native library is not loaded, method returns string "native library not loaded".- Returns:
- version string of native library
-
setLicenseBuffer
public static void setLicenseBuffer(@NonNull byte[] licenseBuffer, @NonNull android.content.Context applicationContext) Set license buffer and unlock the SDK. Application package will be used to validate the license.- Parameters:
licenseBuffer
- Byte array containing the license.applicationContext
- Application context.- Throws:
InvalidLicenceKeyException
- if license is not valid
-
setMicroblinkProxyUrl
Set custom URL for Ping and licence check (used as a proxy). If you need to set the proxy URL, you should do it before setting the license key; otherwise this call won't have any effect. Proxy URL will be applied if the correct license right exists; otherwiseInvalidLicenceKeyException
will be thrown when setting the license key.- Parameters:
url
- String containing the desired URL base. URL has to use HTTPS protocol.- Throws:
IllegalArgumentException
- if the URL is not using HTTPS protocol.
-
setLicenseBuffer
public static void setLicenseBuffer(@NonNull byte[] licenseBuffer, @NonNull String licensee, @NonNull android.content.Context applicationContext) Set license buffer and unlock the SDK. Also define licensee that will be used to validate the license. This method can be used to unlock the SDK in library mode, i.e. when Microblink SDK is being packaged inside 3rd party SDK. Unlocking Microblink SDK in library mode allows usage of single license within multiple application packages.- Parameters:
licenseBuffer
- Byte array containing the license.licensee
- Licensee to which license is given to.applicationContext
- Application context.- Throws:
InvalidLicenceKeyException
- if license is not valid
-
setLicenseKey
public static void setLicenseKey(@NonNull String base64LicenseKey, @NonNull android.content.Context applicationContext) Set license key and unlock the SDK. Application package will be used to validate the license.- Parameters:
base64LicenseKey
- License file encoded as base64 string.applicationContext
- Application context.- Throws:
InvalidLicenceKeyException
- if license is not valid
-
setLicenseKey
public static void setLicenseKey(@NonNull String base64LicenseKey, @NonNull String licensee, @NonNull android.content.Context applicationContext) Set license key and unlock the SDK. Also define licensee that will be used to validate the license. This method can be used to unlock the SDK in library mode, i.e. when Microblink SDK is being packaged inside 3rd party SDK. Unlocking Microblink SDK in library mode allows usage of single license within multiple application packages.- Parameters:
base64LicenseKey
- Byte array containing the license.licensee
- Licensee to which license is given to.applicationContext
- Application context.- Throws:
InvalidLicenceKeyException
- if license is not valid
-
setLicenseFile
public static void setLicenseFile(@NonNull String licenseFilePath, @NonNull android.content.Context applicationContext) Set the license file and unlock the SDK. Application package will be used to validate the license.- Parameters:
licenseFilePath
- Path inside assets where license file should be loaded from.applicationContext
- Application context required to access asset manager.- Throws:
InvalidLicenceKeyException
- if license is not valid
-
setLicenseFile
public static void setLicenseFile(@NonNull String licenseFilePath, @NonNull String licensee, @NonNull android.content.Context applicationContext) Set the license file and unlock the SDK. Also define licensee that will be used to validate the license. This method can be used to unlock the SDK in library mode, i.e. when Microblink SDK is being packaged inside 3rd party SDK. Unlocking Microblink SDK in library mode allows usage of single license within multiple application packages.- Parameters:
licenseFilePath
- Path inside assets where license file should be loaded from.applicationContext
- Application context required to access asset manager.- Throws:
InvalidLicenceKeyException
- if license is not valid
-