Android Studio – General Project Setup – GBG IDscan Documentation

Android Studio – General Project Setup

Add the following lines to the build.gradle file (in-app module):

defaultConfig {
     …// Support for vector drawable.
     vectorDrawables.useSupportLibrary = true// Add if other libraries have more architectures.
     ndk {
         abiFilters "armeabi-v7a”, "arm64-v8a"
         // Supported "armeabi-v7a”, "x86", 'x86_64', "arm64-v8a"
     }
 } 
 // We are using 8 JavacompileOptions {
     sourceCompatibility JavaVersion.VERSION_1_8
     targetCompatibility JavaVersion.VERSION_1_8
 }

Supported Architectures

GBG IDscan supports  ‘armeabi-v7a’, ‘x86’, ‘x86_64’, and ‘arm64-v8a’.

  • There are no known devices running the ‘x86_64’ only emulator, therefore you can exclude it from the final build.
  • You can remove x86 support to reduce the size of your app (in theory, all x86 devices should support ‘armv7’ with approximately 30% reduction in performance).
  • Some exotic devices may not support ‘arm64-v8a’, and as of August 2019, the Google Play store requires that you include ‘armeabi-v7a’ in the apk or bundle.

If you’re facing issues in building the project because of other architectures we don’t support, you can limit the build easily by adding this code to the build.gradle file module:

ndk {

    abiFilters "armeabi-v7a""arm64-v8a"

    // For emulator: x86, x86_64

}

Adding to the manifest file

In the manifest file, the below permissions and features should be added.

<!-- Required for capturing document, selfie and Proof Of Address images -->

<uses-permission android:name="android.permission.CAMERA" />

<!-- Required for communication with IDscan enterprise onboarding service -->

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

<!-- Permission used for liveness action changes if not added we will not vibrate on action change. -->

<uses-permission android:name="android.permission.VIBRATE" />

<!-- Camera features - recommended -->

<uses-feature

    android:name="android.hardware.camera"

    android:required="true" />

<uses-feature   android:name="android.hardware.camera.autofocus"

    android:required="false" />

<uses-feature

    android:name="android.hardware.camera.flash"

    android:required="false" />

Initialising the Android MJCS SDK

You should initialize the SDK before using any SDK function, either before using directly (lazy) or during application/activity creation.

Kotlin

MJCS.init(this@YourActivityActivity) 

Please note: The SDK initialization could take up to a few seconds, therefore it should not be called on the UI thread while IO operations are occurring.

Supported Kotlin versions

All Kotlin versions from 1.5.0+ and higher are supported, although GBG strongly recommends using at least v1.9.10+. If you need to use lower versions and encounter compilation errors, see the migration guide or check the Q&A section below.

Was this page helpful?