Migration 2.x to 3.x version
This document is intended to highlight the main changes from the previous 2.x version and the 3.0 version. For more information, please refer to the javadoc included in the SDK distribution file.
New way to include the library MobbSign
In previous versions, the library was packaged and delivered in a JAR file that was included in the native application as dependency.
From version 3.0 the library is supplied in .aar files and will be delivered as two different files:
mobbsign-sdk-android-3.x.x.aar
MobbSign library core with all functionalities for document signing.
mobb-commons-android-1.x.x.aar
Common components to all Mobbeel products.
In addition, third party libraries have been extracted from the mobbsign library to avoid duplication and incompatibility of library versions. These libraries are:
group: 'com.madgag', name: 'scpkix-jdk15on', version: '1.47.0.2'
group: 'com.madgag', name: 'scprov-jdk15on', version: '1.47.0.2'
In order, to use MobbSign Android SDK in your (native Android) application you must follow these steps:
Include the sdk library (mobbsign-sdk-android-3.x.x.aar and mobb-commons-android-1.x.x.aar)
by copying it to your application’s libs folder and add this line (change it to the correct version) to your build.gradle file (dependencies section):
dependencies {
...
compile group: 'com.mobbeel', name: 'mobbsign-sdk-android', version: “3.x.x”
compile group: 'com.mobbeel', name: 'mobb-commons-android', version: “1.x.x”
// 3rd party libraries
compile group: 'com.madgag', name: 'scpkix-jdk15on', version: '1.47.0.2'
compile group: 'com.madgag', name: 'scprov-jdk15on', version: '1.47.0.2'
}
Add a flatDir repository to your build.gradle file so that gradle can find the “aar” files in your libs folder:
repositories { mavenCentral() flatDir {
dirs 'libs' }
}
Changes in Document Signed Listener.
Added more information to the listener that is launched when the document has been successfully signed.
mobbSignView.setOnDocumentSignedListener(new MobbSignDocumentSignedListener() {
@Override
public void onDocumentSigned(byte[] document, byte[] encryptedSignatureData, Bitmap signatureBitmap, int signaturePage, Rect signatureCoord)
{
// The document has been successfully signed.
}
});
This information is:
@param document The actual signed document bytes.
@param encryptedSignatureData The encrypted signature data (hash, biometric data and more data).
@param signatureBitmap Image of the signature.
@param signaturePage The page of the signature.
@param signatureCoord The coordinates of the signature.
Added a public method to include signed data in signature field.
Added a new public method to write optional data in the signed information of the signature field. The method is:
mobbSignView.addSignedCustomField(String, String);
- Indicates a key-value pair field to be written in the signed information of the signature field.