BlinkID / blinkid-android

Everything you need to add AI-driven ID scanning into your native Android app.
https://microblink.com/identity/identity-document-scanning/
441 stars 153 forks source link

Documentation for removing unused assets with aapt #64

Closed sbaar closed 6 years ago

sbaar commented 6 years ago

You might want to consider adding documentation about removing unused assets for use cases that do not use them. We're using blink just to scan usdls, so removing assets for other languages reduced the final apk from 1 mb with this gradle command

android {
aaptOptions {
        ignoreAssetsPattern "!model_arabic.zzip:!model_malaysian.zzip:!model_micr.zzip:!model_mrtd.zzip:!model_eudl.zzip:" +
        "!de_address_dictionary.zzip:!de_name_dictionary.zzip:!de_surname_dictionary.zzip:!de_dictionary.zzip:!de_confusions.zzip" +
                ":!de_id_confusions.zzip:!cro_address_dictionary.zzip:!cro_name_dictionary.zzip"
    }
}
DoDoENT commented 6 years ago

If you don't need those, you can even further reduce your APK by creating custom build of native binaries. The custom build script will not only throw away resources that you don't need - it will create native libraries that will contain only those features that you really need.

sbaar commented 6 years ago

Awesome ill look into that