Skip to main content

Configuration

This page describes the elements that every integration of the MobbSign Android SDK configures.

License​

The license key is bound to the application ID of your app. The SDK validates it online the first time it is used and every time it expires and is renewed; between validations, signing does not need a connection.

mobbSignView.configureLicense(licenseKey, (licenseValidTo, licenseResult) -> {
if (licenseResult != MobbSignLicenseResult.VALID) {
// Inform the user: documents can be viewed, but not signed
}
});

licenseValidTo is the expiry date of the license. If the license is not valid, the document is still displayed, but any attempt to sign reports ERROR_LICENSE_INVALID.

Encryption key​

setEncryptionKey(PublicKey) sets the public key that encrypts the biometric data of every signature. Without it, documents cannot be signed and onErrorOccurred reports ERROR_MANDATORY_PARAMS. See the quick start for an example that loads a PEM key.

Events​

ListenerCalled when
setOnDocumentShownListenerThe document has been loaded and shown. It receives editable: true if the document contains form fields.
setOnSignButtonPressedListenerThe user taps Sign.
setOnSignatureAcquiredListenerThe user has drawn a signature, before it is confirmed.
setOnSignatureDeletedListenerThe user has deleted the signature drawn.
setOnDocumentSignedListenerA signature has been added to the document.
setOnBackButtonPressedListenerThe user taps Back.
setOnProcessEndListenerThe user has finished. It receives the signed document.
setOnErrorOccurredListenerAn error has occurred. It receives the error code and a map with details.

onDocumentSigned receives the details of the signature just added:

ParameterTypeDescription
documentbyte[]The signed document.
encryptedSignatureDatabyte[]The encrypted signature data: biometric data, document hash and the rest of the signature information.
signatureBitmapBitmapThe image of the signature.
signaturePageintThe page where the signature has been placed.
signatureCoordRectThe coordinates of the signature on the page.

Load a document​

loadPDFDocument accepts a file path or an InputStream. To fill in the form fields of the document when it is loaded, pass a map with the field names and their values:

// From a file path
mobbSignView.loadPDFDocument(filePath, "Service contract");

// From a stream
mobbSignView.loadPDFDocument(inputStream, "Service contract");

// Filling in the form fields
Map<String, Object> fields = new HashMap<>();
fields.put("Name", "Jane Doe");
fields.put("NIF", "99999999A");
mobbSignView.loadPDFDocument(inputStream, "Service contract", fields);

Customisation bundle​

The Bundle passed to the MobbSignView constructor configures the behaviour and appearance of the view. The keys are constants of MobbSignCustomizationProperties:

Bundle customizationBundle = new Bundle();
customizationBundle.putBoolean(MobbSignCustomizationProperties.SHOW_RELEVANT_MESSAGES, true);
customizationBundle.putInt(MobbSignCustomizationProperties.SIGNATURE_MIN_NUM_POINTS, 50);
mobbSignView = new MobbSignView(this, customizationBundle);

To change a property after the view has been created, for example for the next signer, use putCustomizationProperty(key, value). The properties are described in each guide:

AreaPropertiesGuide
Messages and signature validationSHOW_RELEVANT_MESSAGES, SIGNATURE_MIN_NUM_POINTSCustomisation, Signature options
Legal noticeSHOW_BIOMETRIC_SIGNATURE_LEGAL_DIALOG, BIOMETRIC_SIGNATURE_LEGAL_DIALOG_TITLE, BIOMETRIC_SIGNATURE_LEGAL_DIALOG_MESSAGELegal notice
Text stampTEXTSTAMP_SIZE_MIN, TEXTSTAMP_SIZE_MAX, TEXTSTAMP_LINES_MAX, TEXTSTAMP_CHARACTERS_MAXSignature options
GeolocationDEVICE_POSITION_ENABLED, DEVICE_POSITION_LAST_TIME, DEVICE_POSITION_ACCURACYGeolocation

The Javadoc included in the distribution lists every property.