Signature options
Configure the next signature
configureNextSignature sets how the next signature is placed and drawn in the document. Call it before each signature:
SignatureConfiguration config = new SignatureConfiguration();
// Set the properties of the next signature: page, position, signer…
mobbSignView.configureNextSignature(config);
| Property | Description |
|---|---|
positionRect | Position of the signature image on the page. |
positionPage | Page where the signature is placed. |
strokeColor | Colour of the signature stroke. |
strokeWidth | Width of the signature stroke. |
signatureDate | Date of the signature. |
signerName | Name of the signer. |
duplicateSignatureImageList | Range of pages where the signature image is repeated. |
The Javadoc included in the distribution documents the setters of SignatureConfiguration.
Signature method
The signature.type property of the configuration extras selects how the signer signs:
| Value | Description |
|---|---|
SignatureType.HANDWRITTEN | Handwritten signature, with a finger or a stylus. |
SignatureType.FINGERPRINT | Fingerprint, with a Precise Biometrics Tactivo reader. |
SignatureType.ALL (default) | The signer chooses among the methods available. |
SignatureConfiguration config = new SignatureConfiguration();
config.getExtras().putSerializable("signature.type", SignatureType.HANDWRITTEN);
mobbSignView.configureNextSignature(config);
Fingerprint signature
To sign with a fingerprint, install Tactivo Manager from Google Play on the device and declare its permission:
<uses-permission android:name="com.precisebiometrics.android.mtk.manager.permission.BIOMETRIC_DATA" />
Register setOnFingerprintAcquisitionListener to guide the user: it notifies when the sensor is ready (onSensorReadyToSwipe), when an image has been captured (onImageCaptured) and errors such as FINGERPRINT_AREA_TOO_SMALL, FINGERPRINT_QUALITY_TOO_BAD, FINGERPRINT_SWIPE_TOO_FAST or FINGERPRINT_READER_NOT_AVAILABLE.
Minimum length of the signature
Since version 3.6.0, the SDK discards signatures with fewer points than a minimum, so that a stray tap or a short stroke is not accepted as a signature. When a signature is discarded, onErrorOccurred reports ERROR_ACQUIRING_SIGNATURE (code 1) and the capture ends. If SHOW_RELEVANT_MESSAGES is enabled, the user is told that the stroke is too short.
| Property | Type | Default | Description |
|---|---|---|---|
SIGNATURE_MIN_NUM_POINTS | int | 50 | Minimum number of points of a valid signature. |
Text stamp
Add a short text to the visible signature, for example the name of the signer or a reference. Call addTextToSign once the signature has been acquired:
mobbSignView.setOnSignatureAcquiredListener(view -> {
view.addTextToSign("Signed by Jane Doe");
});
The text is drawn in the lower-right corner of the signature image. These properties of the customisation bundle control it:
| Property | Type | Default | Description |
|---|---|---|---|
TEXTSTAMP_SIZE_MIN | int | 8 | Minimum font size. |
TEXTSTAMP_SIZE_MAX | int | 10 | Maximum font size. |
TEXTSTAMP_LINES_MAX | int | 4 | Maximum number of lines. |
TEXTSTAMP_CHARACTERS_MAX | int | 100 | Maximum number of characters. |
Image stamp
setStampImage(Bitmap) draws an image inside the signature, such as a company stamp.
Custom fields
Add your own key-value pairs to the electronic signature, for example a transaction reference:
| Method | Where the field is written |
|---|---|
addSignedCustomField(key, value) | In the signed information of the signature: it is protected against changes. |
addCustomField(key, value) | In the non-visible part of the signature field, outside the signed information. |
mobbSignView.addSignedCustomField("contractId", "C-2026-00042");
Timestamp
A timestamp from a time-stamping authority proves when the document was signed. Configure the server with its URL and, if required, its credentials:
mobbSignView.addTimestampServer("https://tsa.example.com", "username", "password");
Time-stamping services are provided by third parties and are not included in the MobbSign license.