title: Which is best way to define constants in android, either static class, interface or xml resource?
body: <p>I'm developing an android application which uses web service to get data from server, for that I'm having three different set of URLs to point development system, test server and live server. It's difficult to change URL whenever I want to give application for testing/live. so I planned to make it as configurable, so that application can get appropriate URL based on me build type configuration constant. 
  So, </p>
  
  <ul>
  <li>which is the best way to keep this constants, java static class or
  java public interface or xml resource file.? <strong>When? Why?</strong></li>
  <li>which gives better performance?, <strong>When? Why?</strong></li>
  </ul>
  
  <p>Ex: xml resource</p>
  
  <pre><code>&lt;integer name="config_build_type"&gt;0&lt;/integer&gt;
  &lt;string-array name="url_authentication"&gt;
      &lt;item &gt;http://development.com/xxxx&lt;/item&gt;
      &lt;item &gt;http://test.com/xxx&lt;/item&gt;
      &lt;item &gt;http://example.com/xxx&lt;/item&gt;
  &lt;/string-array&gt;
  </code></pre>
  
  <p>Java static constant</p>
  
  <pre><code>public class Config {
      public static final int BUILD_TYPE = 0; // 0 - development, 1 - test, 2 - live
      public static final String[] URL_AUTHENTICATION = {"http://development.com/", "http://test.com/", "http://example.com"};
  }
  </code></pre>