[Android] Use CFFIXED_USER_HOME for bundle path #2520
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For Android, the main bundle path is set to the executable directory, which is something like
/system/bin/app_process32
. As a result, things like localized strings do not work.This PR allows the bundle path to be set by the
CFFIXED_USER_HOME
environmental variable.In my case, I set this in the Kotlin (or Java) initialization code as follows...
I then copy the files from the asset manager into the files directory. This includes
Info.plist
which configures the bundle identifier and development region, anden.lproj/Localizable.strings
which contain the English strings.Once these are in place, I can call
NSLocalizedString
to get the localized string.