Skip to main content

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);
PropertyDescription
positionRectPosition of the signature image on the page.
positionPagePage where the signature is placed.
strokeColorColour of the signature stroke.
strokeWidthWidth of the signature stroke.
signatureDateDate of the signature.
signerNameName of the signer.
duplicateSignatureImageListRange 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:

ValueDescription
SignatureType.HANDWRITTENHandwritten signature, with a finger or a stylus.
SignatureType.FINGERPRINTFingerprint, 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:

AndroidManifest.xml
<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.

PropertyTypeDefaultDescription
SIGNATURE_MIN_NUM_POINTSint50Minimum 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:

PropertyTypeDefaultDescription
TEXTSTAMP_SIZE_MINint8Minimum font size.
TEXTSTAMP_SIZE_MAXint10Maximum font size.
TEXTSTAMP_LINES_MAXint4Maximum number of lines.
TEXTSTAMP_CHARACTERS_MAXint100Maximum 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:

MethodWhere 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");
note

Time-stamping services are provided by third parties and are not included in the MobbSign license.