Documentation

SDK Integration(Android)

Integration Documentation for Android Solution SDK.

Overview

  • Minimum Android version:4.4 (API Level:19)
  • Compilation Android SDK version:API Level:35
  • Target Android SDK version:API Level:35
  • Supported CPU architectures:armeabi-v7a,`arm64-v8a

Installation

  1. Add the maven URL to your settings.gradle file.
    dependencyResolutionManagement {
        repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
        repositories {
            google()
            mavenCentral()
            maven {
                url 'https://public-n3.advai.net/repository/maven-releases/'
            }
        }
    }
  2. Add the dependency in app/build.gradle.
    dependencies {
        implementation "ai.advance.mobile-sdk.android:solution-lib:1.3.0"
    }
  3. For projects that use AndroidX, it is necessary to add the following lines to the gradle.properties file:
    android.useAndroidX=true
    android.enableJetifier=true

Quick Start

  1. Declare the following permissions in the XML file.
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />
  2. Initialize the SDK in your application.
    public class MainApplication extends Application {
    
        @Override
        public void onCreate() {
            super.onCreate();
            GuardianSolutionSDK.init(this);
        }
    }
  3. Sets the appearance mode.
    Options: LIGHT, DARK, FOLLOW_SYSTEM. Default: LIGHT.
    GuardianSolutionSDK.setThemeType(ThemeType.FOLLOW_SYSTEM);
  4. Sets the loading color of the page for both light and dark appearance modes.The provided color value must be in ARGB or RGB format.
    This can be specified as an ARGB hex string:
    GuardianSolutionSDK.setThemeColors(
            new Colors.Builder().setPrimaryColor("#FF000000").build(),
            new Colors.Builder().setPrimaryColor("#FFFFFFFF").build()
    );
    Alternatively, you can use a native resource ID:
    GuardianSolutionSDK.setThemeColors(
            new Colors.Builder().setPrimaryColor(R.color.xxx).build(),
            new Colors.Builder().setPrimaryColor(R.color.xxx).build()
    );
  5. Starts the Solution flow. Pass in your own URL and a callback listener to receive the result.
    GuardianSolutionSDK.start(this, URL, result -> {
        Log.d("SolutionResult", "Code: " + result.getCode() + "\n" + "SignatureId: " +result.getSignatureId());
    });

Code

Result codes