Config getConfig() { switch (BuildConfig.FLAVOR){ case BuildConstants.PROD: case BuildConstants.PROD_KITKAT: return new ProdConfig(); default: return new DevConfig(); } } }
@Override public String getHostUrl(){ return HOST; } @Override public String getApiHostUrl() { return API_HOST; } @Override public String getReportErrorUrl() { return REPORT_ERROR; } } Same would be there for other configs
keep your code modular. • Write Readable code. • Be careful with what you declare in Manifest. • Keep regular committing and raise smaller PRs. • Have pre-commit checks. • Work on Multiple Build Variants • Keep an eye on 3rd party libraries. • Handle Error gracefully. • Test, Test & Test. • Deployment & Distribution pipeline.
is worth getting a premium membership to a food delivery service. You don’t want to be paying recurring delivery charges every time, because that’s expensive! That’s the difference between writing and not writing tests! “ Ragunath Jawahar