Using Different Sources for Testing and Release Android Studio -
i writing tests code make calls restful web service. need use different variables testing, staging , production. example staging release url can 'myapp.staging.com' whereas when test staging flavor should 'localhost/27015'. same goes production flavor. when release should 'myapp.production.com'. how achieve these flavor, buildtype combinations?
you can use buildtype , flavor achieve it.
if want different url different combination can use values inside resources.
using flavor1, flavor2 have 4 build variants.
can set url inside resource, example in strings.xml
file.
can set different files in these folder achieve want.
src/flavor1/ src/flavor1debug/ src/flavor1release/ src/flavor2/ src/flavor2debug/ src/flavor2release/
you can set other values, example applicationid
, in build.gradle
file.
Comments
Post a Comment