Reduce SDK Size

With the Anyline SDK integrated into your app, it is still possible to cut down on the total installable app size by identifying your Anyline use case, and using this to further optimize the app bundle delivered to users. An Anyline SDK bundle comes trained models for all supported use cases, a number of which your application may not require, and hence could be excluded from your build process.

Add the following section in your app level build.gradle file:

android {
    packagingOptions {
        aaptOptions {
            // Enter any modules into "used_modules" you would like to keep and use
            def used_modules = [
                    "module_energy",
                    "module_id",
                    "module_barcode"
            ].toList()

            // Below is the full list of modules
            def all_modules = [
                    "module_anyline_ocr",
                    "module_barcode",
                    "module_document",
                    "module_energy",
                    "module_id",
                    "module_license_plate",
                    "module_tire"
            ].toList()

            // All used modules are kept, the rest are discarded (to shrink your app)
            all_modules.removeAll(used_modules)

            def all_removed_modules = all_modules.join(":")
            ignoreAssetsPattern all_removed_modules
        }
    }
}

Then adjust the required modules in the used_modules array. These are the modules you will need for each technical capability:

Technical Capability Module

VIN

module_anyline_ocr

Container

module_anyline_ocr

OCR

module_anyline_ocr

Barcode

module_barcode

Document

module_document

Meter

module_energy

Universal ID

module_id

MRZ

module_id

Japanese Landing Permission

module_id

License Plate

module_license_plate

TIN

module_tire

Tire Size

module_tire

Commercial Tire ID

module_tire

If the app size remains unchanged after rebuilding, try to uninstalling the .apk first.