android - How to create different build variants pointing to different Servers? -


i using gradle.build auto building app. want generate 3 different apk's each pointing different service url's.

how can make use of buildvariants (productflavors in gradle). i'm not able figure out set 3 url's in gradle.

how can this?

it easy gradle.

productflavors {     first_server {         buildconfigfield "string", "server_url", "\"https://first_server_url/\""     }     second_server {         buildconfigfield "string", "server_url", "\"https://second_server_url/\""     } } 

you may want find more information here.

so later can easy access variable buildconfig.server_url


Comments

Popular posts from this blog

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -