How to save separate settings for my Android apps?

I am developing one of my first Android applications. I came from the ASP.NET world where it is trivial to have separate Web.config files for dev, test and production. Does anyone have a good automated way to do this for Android via Eclipse?

+3
source share
2 answers

Have an ant command line system that accepts "dev", "test", "production" as parameters and copies in the corresponding xml files for assembly. This assumes that you already have a set of xml / config files for them.

+1
source

I know the question is lingering, but I will answer.

'dev', 'test', 'production' Gradle.

build.gradle buildTypes :

buildTypes {
    release {
      runProguard false
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      debuggable false
      versionNameSuffix "r"
    }

    debug {
      versionNameSuffix "d"
      debuggable true
    }

    test {
      applicationIdSuffix ".test"
      versionNameSuffix "t"
      debuggable false
    }

:

  • config release, .
  • versionNameSuffix ,
  • set applicationIdSuffix test release
  • Gradle : src/ [buildtypename]/res. , .

http://tools.android.com/tech-docs/new-build-system/user-guide

+1

Source: https://habr.com/ru/post/1762113/


All Articles