Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Note that if you are using default Eclipse builds it probably uses a specially configured 'Ant' module within eclipse. You can check on the degree of Eclipse/Ant coordination by checking 'Window/Preferences/Ant' section in eclipse/Prefs....</p> <p>One solution is to make more explicit, the collaboration of Eclipse/Ant so that a 'build.xml' file is part of your project ( project level build file rather than the default file copied in at build time from the $SDK/ROOT folder ). </p> <p>see <a href="http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html" rel="nofollow">here</a> and read the comments at bottom <a href="https://github.com/jeremyhaberman/android-custom-builds/blob/master/build.xml" rel="nofollow">here</a> to get better idea of how a project level 'build.xml' file is used. </p> <p>Once you've digested that , the solution below will make more sense... </p> <p><strong>--Solution--</strong></p> <p>Modify the Release and the Debug sections of you 'build.xml' file as follows:</p> <pre><code> &lt;!-- **************** Debug specific targets *************** --&gt; ... &lt;target name="-set-debug-mode" depends="-setup"&gt; ... &lt;!-- API modify belo for build-typ --&gt; &lt;copy file="config/strings.xml" todir="res/values"&gt; &lt;filterset&gt; &lt;filter token="CONFIG.API" value="${config.db.api}"/&gt; &lt;filter token="CONFIG.REST" value="${config.db.rest}"/&gt; &lt;/filterset&gt; &lt;/copy&gt; ... &lt;!-- *************** Release specific targets ************** --&gt; ... &lt;target name="-set-release-mode" depends="-set-mode-check"&gt; ... &lt;!-- API modify belo for build-typ --&gt; &lt;copy file="config/strings.xml" todir="res/values"&gt; &lt;filterset&gt; &lt;filter token="CONFIG.API" value="${config.db.api.prod}"/&gt; &lt;filter token="CONFIG.REST" value="${config.db.rest.prod}"/&gt; &lt;/filterset&gt; &lt;/copy&gt; </code></pre> <p>And in the 'ant.properties' file in your root folder, put the property values for the API keys and whatever...</p> <pre><code># API condition builds dev|prod in DB @parse.com config.db.api=some_key_val config.db.rest=some_k2_val config.db.api.prod=some_k3_val config.db.rest.prod=some_k4_val </code></pre> <p>And tie it together in a resource xml that is the target of the 'copy' commands in the build... </p> <pre><code> 'config/strings.xml' &lt;string name="default_value_parse_key_appId"&gt;@CONFIG.API@&lt;/string&gt; &lt;string name="default_value_parse_key_rest"&gt;@CONFIG.REST@&lt;/string&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload