Question: Let's say we have strings\_test.xml, which stores string values for testing and should be shown in a debug-release. When the apk gets build as a release version all values should be change to an empty string e.g. `<string name="test_some_card_text">@string/empty</string>`.

Is there a possibility to achieve this?

As always, thanks in advance.

Answer: 
Yes you can do that inside your app gradle under buildTypes..

```
 buildTypes {
        mybuild {
                 resValue "string", "test_some_card_text", '"test"'
                 resValue "string", "other_text", '"other"'
                }
         debug {
                 resValue "string", "test_some_card_text", '"test"'
                 resValue "string", "other_text", '"other"'
              }
          }

```

Then access it like this.

```
getApplicationContext().getResources().getString(R.string.test_some_card_text);
getApplicationContext().getResources().getString(R.string.other_text);

```

For build you need to select that `build variants` and have to build it.
For those who come here looking for some way to apply a similar method to `raw` resources, I dealt with it using `buildConfigField`.

```
gradle
...
buildTypes {
    debug {
        ...

        buildConfigField "int", "shared_resource_name", 'R.raw.debug_resource_name'

        ...
    }
    prod {
        ...

        buildConfigField "int", "shared_resource_name", 'R.raw.prod_resource_name'

        ...
    }
}

```

Pay attention to the quotes. After that, place `BuildConfig.shared_resource_name` in the files wherever `R.raw.resource_value` used to be accessed directly.

This can be used to other resources I think.