Modify the colors.xml file of an android project from an external xml

2

I have this xml in my android project /res/values/colors.xml :

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#77ac5f</color>
    <color name="colorPrimaryDark">#558a3d</color>
    <color name="colorFondo">#e9e9e9</color>
</resources>

And I have an xml on a server that is generated from a backoffice that has this format:

<colores>   
    <color><hex>#ffffff</hex></color>
    <color><hex>#ffffff</hex></color>
    <color><hex>#ffffff</hex></color>
</colores>

What I want is that if the app has an internet connection, get the data of xml and modify the file colors.xml . Is it possible to do what I say?

    
asked by 08.06.2017 в 13:22
source

1 answer

1
  

Modify the colors.xml file of an android project from an xml   external

The xml of the resources can not be modified, since they are read only. You can not modify these resources, what I suggest is to take the colors of the file that you suggest and not to make reference to those found in colors.xml

    
answered by 08.06.2017 / 17:10
source