Reputation: 9457
I'm building an android app with 2 versions of paid and free. Basically I have a library project with all the logic and 2 skeleton projects for each version. Now I need some kind of build flags to distinguish between the versions. Is this possible?
Upvotes: 5
Views: 1090
Reputation: 74790
You actually do not need build flag for that. Here is how you can achieve this:
<bool name="type.free">true</bool>
<bool name="type.free">true</bool>
<bool name="type.free">false</bool>
And then at any point in your Library Project you can check the value of Boolean resource and decide what you need to do. Of cource, you'll need access to Context
object for this.
Upvotes: 6