Reputation: 369
Please guide me, i want to create app with some audio files in assets folder, these files is different for every language, like: 'assets/en/hello.mp3' and 'assets/fr/hello.mp3'.
I want to build my app with 'android app bundle', so that user with specific language can get his/her language assets with smaller build file size.
So how to architect my app with android app bundle?
Upvotes: 0
Views: 427
Reputation: 17437
No build system has native support for this feature yet unfortunately, however bundletool and Play already support it, so if you organize your asset files after the following pattern, it should just work:
assets/<dirname>#lang_en/hello.mp3
assets/<dirname>#lang_fr/hello.mp3
assets/<dirname>/hello.mp3
Where "<dirname>" is any string you want. The last file in my example would be only delivered to users which have neither French nor English as their language on the device.
Note that when the user changes the language on the device, it will take a few hundreds or milliseconds or seconds to download the right asset, so you'll have to manage this transition on your own (i.e. you can't assume that the asset is already on the device for the new language as it may not have been downloaded yet).
Upvotes: 2