Android SDK

The Quikkly Android SDK is split into two parts: quikklycore-lib, which contains only pure Java bindings for the Quikkly native library, and quikkly-lib, which adds Android UI and components on top of it.

JavaDocs

Getting Started

Add Quikkly SDK to your build.gradle

repositories {
    maven { url 'http://developers.quikkly.io/nexus/repository/maven-releases/' }
}

dependencies {
    ...

    implementation 'net.quikkly.core:quikklycore-lib:3.4.5@jar'
    implementation 'net.quikkly.android:quikkly-lib:3.4.5@aar'

    // Dependencies required by quikkly-lib
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:support-v13:27.1.1'
    implementation 'commons-io:commons-io:2.5'
    implementation 'commons-codec:commons-codec:1.11'
    api 'com.caverock:androidsvg:1.2.1'
}

Please note the different Maven group ID (net.quikkly.core and net.quikkly.android) and different package types (jar and aar) between the libraries.

The Android Support library and Apache Commons library versions do not have to be exactly those - slightly older or newer versions should work as well. If you find some that do not, please let us know.

Load the Quikkly SDK on app startup

Add the following somewhere in your app, in a place where it is run before any other usage of the Quikkly SDK. Common places are MainActivity.onCreate() or MyApp.onCreate().

if (!Quikkly.isConfigured()) {
    Quikkly.configureInstance(this, 2, 0);
    QuikklyCore.checkLinking();
}

Quikkly.configureInstance() takes three parameters: current Context, number of maximum background threads (2 is a good default), and number of milliseconds to pause scanning between each camera frame (0 is a good default).

Launch ScanActivity

ScanActivity.launch(this, 1, true, false);

ScanActivity.launch() takes four parameters: current Context, camera zoom (1…2 is a good default), whether to enable result overlay, and whether to enable status overlay.

Use ScanFragment to handle results

Use RenderTagView to generate and display codes

Supported Platforms

Quikkly supports API level 16 (Android 4.1 Jelly Bean) and upwards.

The SDK contains native libraries built for ARM-v7a, ARM64-v8a, and both 32bit and 64bit x86 CPUs. The first two are required for mobile usage, and the last two for Android simulator on the desktop.

Removing x86 libraries from your APK

You can reduce the size the Quikkly SDK in your app by 50% by stripping out the x86 native libraries from your release builds. However, these APKs will no longer work on the Android simulator.

To remove x86 libraries, add the following to your app/build.gradle file:

android {
    ...

    packagingOptions {
        exclude 'jni/x86/libquikklycore.so'
        exclude 'jni/x86/libquikklycore-jni.so'
        exclude 'jni/x86_64/libquikklycore.so'
        exclude 'jni/x86_64/libquikklycore-jni.so'

        exclude 'lib/x86/libquikklycore.so'
        exclude 'lib/x86/libquikklycore-jni.so'
        exclude 'lib/x86_64/libquikklycore.so'
        exclude 'lib/x86_64/libquikklycore-jni.so'
    }
}

Applying Styles and Themes

Loading Custom Blueprints

If you have a custom blueprint_xxxx.json file from us, you can enable it in the Android SDK by:

  1. Copy the file to the app/src/main/assets/ directory in your Android project.
  2. Use the four-argument Quikkly.configureInstance():
    Quikkly.configureInstance(<context>, "blueprint_xxxx.json", <max-threads>, <frame-delay-ms>);