initialize

Initializes Nutrient with a license key. This must be called before any other call to methods in this class.

This method can safely be called multiple times and is not needed when using com.pspdfkit.ui.PdfFragment or com.pspdfkit.ui.PdfActivity.

Parameters

context

Application context.

options

Extra initialization options, for example license key string. See InitializationOptions. Pass an empty string as InitializationOptions.licenseKey for trial purposes. A null key defers licensing so it can be set in a later initialize call.

Throws

If license is not valid for this app.

If current device isn't compatible with Nutrient (e.g. Android < 5.0 or wrong ABI) or if some other error occurred.

If RxAndroid or RxJava dependencies are missing in the containing app.


fun initialize(context: Context, licenseKey: String)

Helper for the main initialise method. Useful if you only want to initialise with a license key and want to leave other options as default.

Parameters

context

Application context.

licenseKey

A valid Nutrient license key. Pass an empty string to initialize in trial mode.