Android app size and lib_FoundationICU.so

Ahh, well that effectively eliminates options #2 and #3, since I don't think Android's built-in ICU is ever likely to provide functions like ualoc_getAppleParent.

Yes, I'm thinking that externalizing the data to a separate file will be the solution (like on macOS: /usr/share/icu/icudt74l.dat). This is tricky on Android due to the way they expect assets to be accessed (see: Overriding Bundle.module for loading resources from Android assets). But one immediate benefit is that the app would only need to contain one single instance of the data file, rather than repeating it N times for each supported architecture.

In addition, this opens the possibility of performing some "thinning" of the ICU data to only include those locales that are supported by the containing app. This is what Flutter does to keep its bundled ICU data size as minimal as possible. This thinning could be done as a post-processing step by the packaging tool for the app.

2 Likes