title: Android - Best way to use colors from JSON file
body: <p>I'm working on an app that will retrieve a <strong>colors.json</strong> file from server. This file will have the following structure:</p>
  
  <pre><code>[
      {"ServerActionButton.background.normal":
          { "red": 29, "green": 188, "blue": 189, "alpha":255}
      },
      {"ServerActionButton.background.disabled": 
          { "red": 164, "green": 228, "blue": 229, "alpha":255}
      },
      {"ServerActionButton.title.normal": 
          { "red": 255, "green": 255, "blue": 255, "alpha":255}
      },
      ...
  ]
  </code></pre>
  
  <p><strong>This JSON should be retrieved on app startup, and I should be able to use these colors throughout the whole app.</strong></p>
  
  <p>Question: What's the best way to do this? I've thought about the following options:</p>
  
  <ul>
  <li>Generating a resource XML file from the JSON (it would be great, but is it possible?).</li>
  <li>Mapping the JSON to a model, and then storing it in SharedPreferences.</li>
  <li>Building a local database with the data retrieved from the JSON.</li>
  </ul>
  
  <p>Which would be the best approach? Is there some other possibility I'm not considering?</p>
  
  <p>Thanks in advance!</p>