Issue
I have an Android project which uses Android.mk files for the setup. I would like to introduce Build Variants to the project and based on a build var such as BUILD_BRAND to perform some UI changes.
My case is:
I have BUILD_BRAND exported on my Ubuntu in the .bashrc
.
If I echo $BUILD_BRAND
I would get the value printed in the terminal.
I also do $(warning $(BUILD_BRAND))
and I can see during the build the value is printed so it is available.
But when I try to do System.getEnv("BUILD_BRAND");
in an activity, a null is returned.
The question is how to make this value under BUILD_BRAND to become globally available to the project.
Thanks!
Solution
In my case the solution was to use SystemProperties.get("the.property.name")
.
The "the.property.name"
was set in the Makefile.mk located in the core.
I also find out that I can export ENV vars to the project during build time using the same Makefile.mk.
N.B - You can't access an env var during runtime directly using System.getEnv()
!
Answered By - Top4o Answer Checked By - Mary Flores (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.