Configure the SDK
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
andmobb-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.3.x” compile group: 'com.mobbeel', name: 'mobb-commons-android', version: “1.3.x” // 3rd party libraries compile 'com.madgag.spongycastle:prov:1.54.0.0' compile 'com.madgag.spongycastle:pkix:1.54.0.0' compile group: 'com.squareup.retrofit2', name: 'retrofit', version: '2.1.0' }
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' } }
Add internet and write external storage permissions in the AndroidManifest.xml of your project (the first is needed to check license and the second to store temporary files during signature process)
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
It’s highly recommended to include the following option in your application tag of the AndroidManifest.xml file:
<application android:largeHeap="true" ...
Create your MobbSignView in your Activity. You can choose to create the view in your own layout xml file or doing it programmatically.
On layout.xml file:
<com.mobbeel.mobbsign.view.MobbSignView android:id="@+id/mobbsignview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars = "vertical|horizontal"/>
Programmatically:
mobbSignView = new MobbSignView(this, null); setContentView(mobbSignView);