Add the repository
maven { url 'https://public-n3.advai.net/repository/maven-releases/' }Click to download the UI source code.
Module Integration: Extract the downloaded zip file to obtain the SDK module. Import this module into your project and use it as a standard project module. Important: If your project uses AndroidX libraries, make sure to migrate any remaining android.support references to their androidx equivalents.
If your application has package size constraints or you need to reduce the app bundle size, you can optimize by excluding the model file module from the dependencies in step 2. This modification reduces the SDK package size by approximately 1MB. The model files will be downloaded automatically when users first launch the SDK. Please be aware that network connectivity issues may cause download failures.
implementation ('ai.advance.mobile-sdk.android:global-iqa-lib:1.4.2'){ exclude group: 'ai.advance.mobile-sdk.android', module: 'global-iqa-model'}Initialize the SDK
Add the following initialization code to the custom application
GlobalIQASDK.init(application);Check license.
The license is obtained by your server calling our openAPI, you need to check license before starting the IQA activity.
String license = "xxx";String checkResult = GlobalIQASDK.setLicenseAndCheck(license);if ("SUCCESS".equals(checkResult)) { // license valid startGlobalIQAActivity();} else { // license is not available, expired/wrong format/appId not filed}User binding (highly recommended).
You can use this method to pass us your unique user ID, and we will establish a mapping relationship based on that ID. It's easy to track logs with us in case of problems.
GlobalIQASDK.bindUser(String userId); Below is a simple startup method. You can adjust the layout of the Activity to modify the UI.
public void startIQAActivity(String region,CardType cardType,CardSide cardSide){ Intent intent = new Intent(MainActivity.this, GlobalIQAActivity.class); intent.putExtra(GlobalIQAActivity.EXTRA_IQA_EXTRAS, new IQAExtras.Builder(region, cardType, cardSide) .setSoundPlayEnable(true) .build()); startActivityForResult(intent, requestCode);}
@Overrideprotected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { if (requestCode == REQUEST_CODE_IQA) { boolean success = GlobalIQAResult.isSuccess(); String eventId = GlobalIQAResult.getEventId(); if (success) { String idvid = GlobalIQAResult.getIDVID();// image id Bitmap bitmap = GlobalIQAResult.getBitmap();// Image in bitmap format String pictureType = GlobalIQAResult.getPictureType();// Picture type,"takePhoto" or "scan" String base64Image = GlobalIQAResult.getBase64Image();// Image in base64 format JSONObject idForgeryResult = GlobalIQAResult.getIdForgeryResult();// ID forgery result JSONObject ocrResult = GlobalIQAResult.getOCRResult();// ocr result String transactionId = GlobalIQAResult.getTransactionId();// transaction id boolean pay = GlobalIQAResult.isPay();// Whether this call is billed or not } else { String errorCode = GlobalIQAResult.getErrorCode();// error code String errorMsg = GlobalIQAResult.getErrorMsg();//error message,may be null String transactionId = GlobalIQAResult.getTransactionId();//transaction id,may be null } }}Get eventId
After each process completes, retrieve the session event ID using this method. Save this ID—it enables quick log identification when reporting issues to our support team.
String eventId = GlobalIQAResult.getEventId();
See FAQ