In the process of developing an Android app, I want to allow certain features if we're testing/debugging, and disallow the features when the app is in production. What's the best way to accomplish this? I've found some potential solutions in setting launch flags or setting intent flags when launching the main activity, but I don't know these will actually solve my problem, nor do I know the "best practices".
Its pretty simple, as you want to set some feature available for debuge/test mode and some feature available for production app. You just have to use below code:
if (BuildConfig.DEBUG) {
// do something for a debug build
} else {
// do something for a Production app.
}
Like this way you do not need to make different application for debug amd release app.