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 |
---|---|---|---|
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 |
---|---|---|---|
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 |
Version 54
MODULE(S) | SIZE OF ALL ADDED | OVERALL SIZE | SIZE WHEN REMOVED |
---|---|---|---|
All Modules | 96MB | 68.8MB | 27.8MB |
module_tire | 96MB | 10.8MB | 85.2MB |
module_license_plate | 96MB | 9.5MB | 86.5MB |
module_document | 96MB | 290.1KB | 95.7MB |
module_barcode | 96MB | 8KB | 95.9MB |
module_anyline_ocr | 96MB | 9.8MB | 86.2MB |
module_id | 96MB | 17.8MB | 78.2MB |
module_energy | 96MB | 20.9MB | 75.7MB |
What exactly does the Bundle SDK include?
THE ANYLINE SDK EXAMPLES BUNDLE FOR ANDROID |
THE ANYLINE SDK EXAMPLES BUNDLE FOR iOS |
THE ANYLINE SDK EXAMPLES BUNDLE FOR UWP |
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"
}
}