Table of Contents | ||||
---|---|---|---|---|
|
...
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.
...
Info |
---|
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 |
...
What exactly does the Bundle SDK include?
...
THE ANYLINE SDK EXAMPLES BUNDLE FOR ANDROID |
...
Expand | ||
---|---|---|
| ||
|
...
Reducing the Size of the SDK
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
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.
...
Code Block | ||
---|---|---|
| ||
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 } } |
Note |
---|
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.
...
Code Block | ||
---|---|---|
| ||
packagingOptions { aaptOptions { ignoreAssetsPattern "module_energy:module_id:module_anyline_ocr:module_barcode:module_document:module_license_plate:module_tire" } } |
Note |
---|
WARNING: Please be sure to remove the module(s) you require! |
NOTE: Use either option 1 or option 2.
...
Video Tutorial
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
To watch the video tutorial for Android, please click here. |
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
...
...
Important Notes
Infonote |
---|
Important: Uninstall your app on the smartphone if you launch a new version of your app. When you do a build of your project existing assets on a smartphone will NOT be deleted. When you start your app containing the Anyline SDK the first time on your smartphone our SDK copies assets into a local folder. If in the future assets will be changed or deleted our SDK checks if this local folder exists. If yes, files will not be overwritten. So uninstall your app before you install a new version. |
...
Links to Documentation
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
If you require any further information or details on our size reduction for the Anyline Android SDK, |