Getting started

In this guide, you will learn how to get started with the Genius Scan SDK for Android.

Overview

The Genius Scan SDK for Android is composed of multiple Android libraries, which enables you to integrate just what you need.

  • gssdk-core: The core module of the SDK, including the low-level image processing, basic UI components, and PDF generation. You always have to integrate this framework into your app.
  • gssdk-ocr: The OCR module which allows to extract text (and layout) from images. Only integrate this if you plan to perform local text recognition on your documents.
  • gssdk-scanflow: A high-level scanner module that simplifies the integration of the SDK in your app. Only integrate this if you choose to do a simple integration of the SDK.

Sample code

We provide two demo projects in the SDK Demo apps repository:

  • demo-simple: it shows how to start a simple scan flow using gssdk-scanflow. The different screens are customizable via a ScanConfiguration.
  • demo-custom: this demo showcases how to build custom scan screens using the gssdk-core module. It also shows how to run OCR before generating a PDF file.

In order to run the provided demos, open the root folder in Android Studio.

Size of the SDK

The Android SDK includes support for the following CPU architectures: x86, x86_64, armeabi-v7a, arm64-v8a. When integrated into your app, the SDK will increase the size of your APK by the sizes in the following table:

Module x86 x86_64 armeabi-v7a arm64-v8a universal
gssdk-core 9.6MB 10.3MB 8.2MB 8.9MB 19.7MB
gssdk-ocr 1.4MB 1.5MB 984.7KB 1.3MB 5.1MB
gssdk-scanflow - - - - <1MB

If you’d like to optimize the size of your app, you can either:

Setup

Add the SDK modules to your app

Add the following code to your app’s build.gradle:

Gradle DSL
  repositories {
     // ...
     maven { url 'https://s3.amazonaws.com/tgl.maven' }
  }

  dependencies {
    // ...
    implementation 'com.geniusscansdk:gssdk-core:4.0.0-beta10'

    // Optionally:
    implementation 'com.geniusscansdk:gssdk-ocr:4.0.0-beta10'
    implementation 'com.geniusscansdk:gssdk-scanflow:4.0.0-beta10'
  }

Configure your license key

The Genius Scan SDK is subject to a commercial license: a license key is needed to initialize the SDK. The key must match your application identifier (aka. bundle ID) and the license’s expiration date. Please contact us if you don’t have a license key yet.

The SDK can run without a license key but will stop working after 60 seconds.

You initialize the SDK with your license key as follows. The best place to initialize the SDK is in the main Activity of your application:

Kotlin
try {
  GeniusScanSDK.init(context, "Your key")
} catch (e: InitializationException) {
  // The license is expired or invalid
}
Java
try {
  GeniusScanSDK.init(context, "Your key");
} catch (InitializationException exception) {
  // The license is expired or invalid
}

This method throws an InitializationException when the license cannot be validated or has expired. It is advised to catch it and show a message to your users asking them to update the app.

Next steps

Once you have done this, you’re ready to start your actual implementation. The next steps will depend whether you chose the simple integration, using the ScanFlow module, or if you are going for a custom integration.

© 2020 The Grizzly Labs, Inc. All rights reserved.