Size of the Anyline SDK Bundle Explained - Android

 


Why is the Anyline SDK Bundle so large? 

Integrating our SDK can add up to 90MB for Android, 50MB for iOS and 20MB for Windows, due to all the necessary resources for all the processing. We are working on this and hope to be able to optimise further in the future.

Please note that the Anyline SDK requires the inclusion of computer vision and machine learning libraries, because there is no server side processing. This enables fully offline functionality and increased safety. The combination of all these resources, therefore, increases the size of our SDK.

Below is a table of how much space each module takes up in your app.

Version 42.3.0

MODULE(S)

SIZE OF ALL ADDED

OVERALL SIZE

SIZE WHEN REMOVED

MODULE(S)

SIZE OF ALL ADDED

OVERALL SIZE

SIZE WHEN REMOVED

All Modules

133.3MB

73.7MB

59.9MB

module_tire

133.3MB

12.5MB

120.8MB

module_license_plate

133.3MB

9.7MB

123.6MB

module_document

133.3MB

0.6MB

132.7MB

module_barcode

133.3MB

0MB

133.3MB

module_anyline_ocr

133.3MB

10.3MB

123MB

module_id

133.3MB

18.7MB

114.6MB

module_energy

133.3MB

21.9MB

111.4MB

Version 43

MODULE(S)

SIZE OF ALL ADDED

OVERALL SIZE

SIZE WHEN REMOVED

MODULE(S)

SIZE OF ALL ADDED

OVERALL SIZE

SIZE WHEN REMOVED

All Modules

181.8MB

73.6MB

108.2MB

module_tire

181.8MB

12.5MB

169.3MB

module_license_plate

181.8MB

9.7MB

172.1MB

module_document

181.8MB

0.5MB

181.3MB

module_barcode

181.8MB

0MB

181.8MB

module_anyline_ocr

181.8MB

10.3MB

171.5MB

module_id

181.8MB

18.7MB

163.1MB

module_energy

181.8MB

21.9MB

159.9MB

 


What exactly does the Bundle SDK include? 

 

THE ANYLINE SDK EXAMPLES BUNDLE FOR ANDROID

  • The Anyline SDK in the latest version for offline integration

  • A build version of the Anyline OCR Examples App

  • The source code of the Anyline OCR Examples App

  • The Javadoc for the Anyline SDK

  • This documentation

  • The third party licenses

  • A Readme

  • The current Release Notes

THE ANYLINE SDK EXAMPLES BUNDLE FOR iOS

  • Framework: Contains the Anyline.framework and AnylineResources.bundle

  • Documentation: Contains a html and docset version of an appledoc style interface documentation

  • AnylineExamples: Contains a simple app where each plugin is implemented - it can be installed right away

  • LICENSE: The Third Party License Agreements

  • RELEASE_NOTES: Information about any changes

THE ANYLINE SDK EXAMPLES BUNDLE FOR UWP

  • The Anyline SDK in the latest version for offline integration

  • The source code of the Anyline Windows Examples App

  • The code documentation for the Anyline SDK

  • The third party licenses

  • The API Reference

  • A Readme

 


Reducing the Size of the SDK

An Anyline SDK bundle comes with trained models for all supported modules, a number of which your application may not require, and hence could be excluded from your build process.

Starting with Anyline SDK version 41 the build process can be tuned to exclude not used modules from your app.

Option 1

One way to reduce the size of the SDK is to first enter the modules you wish to use. Then, define the full list of modules, as show below, and then remove all of your required modules from that list. Finally, combine all the modules you do not wish to use and finally remove them. This option is useful if you wish to see the module you are using clearly and that it is not removed from the SDK.

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

packagingOptions { aaptOptions { // Enter any modules into "used_modules" you would like to keep and use def used_modules = [ "module_license_plate" ].toList() // Below is the full list of modules def all_modules = [ "module_anyline_ocr", "module_barcode", "module_document", "module_energy", "module_id", "module_tire", "module_license_plate", ].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 } }

WARNING: Please make sure not to delete the module(s) you require!

Option 2

An even easier way is to simply include all the modules you do not wish to use and not include the modules you do wish to use. There is less code this way and it performs the exact same task.

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

packagingOptions { aaptOptions { ignoreAssetsPattern "module_energy:module_id:module_anyline_ocr:module_barcode:module_document:module_license_plate:module_tire" } }

 


Video Tutorial

Just as the video demonstrates, you can simply right-click the project folder and select “Get Info” on Mac (or “Properties” on Windows) to see the size reduction. However, if you wish to see specifically where the size reduction is occurring within the project, navigate directly to the .apk file.

Please see the example images provided below:

BEFORE

AFTER

 


Important Notes