I'm just reviving this old request. I really would like to see something like this. I think it could be done in a way that the package name, icon, code, etc. can all be conditional. B4A would just have to process this stuff "first", then ignore it when actually compiling the app.
While it's nice that we can edit some of the app attributes at the special section in the beginning of the "main" module, this has actually somewhat made things more difficult depending on the situation.
For example, I do share the same code for free/paid versions and use a boolean to toggle them when compiling. To be accessible from all modules, that boolean is declared and set in a "common" code module. So now when I compile my project (free & pro, each for Google and Amazon... 4 times) I need to confirm the following:
1) Go to Project menu to change/confirm the package name
2) Go to Common module to change/confirm the free/pro boolean, Amazon/Google variable, and version number(version string to access in the app)
3) Go to Main module to change/confirm the app and label and version code/number.
This is a lot of bouncing around. If we can't have conditional compile, I would almost like to see it all consolidated into one option window like what was also brought up a while back, but that was before some of the app's settings were moved to the Main module.
Some other thoughts: How about several pre-defined variables and booleans that are somewhat built into B4A that we can define the values of in one "options" screen in the IDE and access their values in our code?
Such as these in a settings window (where the brackets are a text field where user can enter a value):
MyApp.PackageName [com.my.package]
MyApp.AppLabel [My App Name]
MyApp.VersionCode [51]
MyApp.VersionString [v3.5.1]
MyApp.CustomString (1) [Amazon]
MyApp.CustomString (2) [ ]
MyApp.CustomString (3) [ ]
MyApp.CustomString (4) [ ]
MyApp.CustomString (5) [ ]
MyApp.CustomBoolean (1) [True]
MyApp.CustomBoolean (2) [False]
MyApp.CustomBoolean (3) [False]
MyApp.CustomBoolean (4) [False]
MyApp.CustomBoolean (5) [False]
Then in the code....
'(Main Module)
#ApplicationLabel: MyApp.AppLabel
#VersionCode: MyApp.VersionCode
#VersionName: MyApp.VersionString
#PackageName: MyApp.PackageName <---- This does not currently exist... package name cannot be defined in the main module.
'(Common Module)
Dim ThisAppIsProVersion as Boolean = MyApp.CustomBoolean (1)
Dim ThisAppMarketVersion as String = MyApp.CustomString (1)
I'd prefer conditional compile but I'd be happy with something like this for now... where we can at least consolidate all of the different things related to our app's version, market destination, etc. could be handled in one place.
Any thoughts?