Skip to main content

Installation

The MobbSign Android SDK is delivered as a ZIP file that contains the SDK libraries, a sample application and a test encryption key.

Requirements​

Android
4.1 or laterAPI level 16
License
License keyBound to your application ID. Provided by Mobbeel.
Encryption key
Public key of your projectA test key is included in the distribution.
Network
Internet connectionOnly to validate the license the first time and when it is renewed.
Input
TouchscreenA stylus is recommended.

Before you begin​

You need two items from Mobbeel:

  • A license key bound to your application. It is generated for the application ID declared in your app (applicationId in Gradle). The SDK validates it online the first time it is used and every time it is renewed.
  • The public encryption key of your project, a .key file. The SDK uses it to encrypt the biometric data of every signature. The distribution includes a test key; you need a production key before releasing your app. See The signature package.

1. Add the libraries​

Copy the SDK libraries from the libs folder of the distribution to the libs folder of your app module:

LibraryProvides
mobbsign-sdk-android-3.x.x.aarThe MobbSign SDK: PDF viewer, signature capture and signing.
mobb-commons-android-1.x.x.aarComponents shared by Mobbeel products.

Declare the libraries and their third-party dependencies in the build.gradle file of your app module, replacing x.x with the versions of your distribution:

app/build.gradle
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}

dependencies {
implementation(name: 'mobbsign-sdk-android-3.x.x', ext: 'aar')
implementation(name: 'mobb-commons-android-1.x.x', ext: 'aar')

// Third-party libraries
implementation 'com.madgag.spongycastle:prov:1.54.0.0'
implementation 'com.madgag.spongycastle:pkix:1.54.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
}

2. Declare the permissions​

Add the permissions to the AndroidManifest.xml of your app. The SDK needs internet access to validate the license and write access to store temporary files during the signing process:

AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

If you add the location of the device to the signatures, declare the location permissions too.

3. Enable a large heap​

PDF rendering can use a significant amount of memory. We recommend enabling a large heap for your app:

AndroidManifest.xml
<application
android:largeHeap="true"
...>

4. Add the encryption key​

Copy the public key of your project to the assets folder of your app, for example src/main/assets/mobbsign.key. The quick start shows how to load it.

Sample application​

The sample folder of the distribution contains a ready-to-run project that loads a PDF and lets you sign it. Open it with Android Studio, configure your license key and run it on a device.

Troubleshooting​

  • Gradle cannot resolve the .aar files
    Check that the files are in the libs folder of the app module, that the flatDir repository is declared, and that the file names in dependencies match those of your distribution.
  • The document is shown but cannot be signed
    The license or the encryption key is missing or invalid. Check the license result and the onErrorOccurred events. See Configuration.
  • OutOfMemoryError with large documents
    Enable android:largeHeap in the manifest.

Next step​

Configure the SDK and sign your first document in the Quick start.