title: Using HashMap to map a String and int
body: <p>I have a ListView showing names of countries.
  I have stored the names in strings.xml as a string-array called <strong>country_names</strong>.</p>
  <p>In populating the ListView, I use an ArrayAdapter which reads from strings.xml:</p>
  <pre><code>String[] countryNames = getResources().getStringArray(R.array.country_names);
  ArrayAdapter&lt;String&gt; countryAdapter = new ArrayAdapter&lt;String&gt;(this, R.layout.checked_list, countryNames);
  myList.setAdapter(countryAdapter);
  </code></pre>
  <p>Now I also have a CountryCode for each country. When a particular country name is clicked on the ListView, I need to Toast the corresponding CountryCode.</p>
  <p>I understand implementing a HashMap is the best technique for this. As far as I know, the HashMap is populated using put() function.</p>
  <pre><code>myMap.put(&quot;Country&quot;,28);
  </code></pre>
  <p>Now my questions are:</p>
  <ol>
  <li><p>Is it possible to read the string.xml array and use it to populate the Map? I mean, I want to add items to the Map, but I must be able to do so by reading the items from another array. How can I do this?</p>
  <p>The basic reason I ask is because I want to keep the country names and codes in a place where it is easier to add/remove/modify them.</p>
  </li>
  <li><p>The string-arrays are stored in strings.xml. Where must similar integer arrays be stored? In values folder, but under any specific XML file?</p>
  </li>
  </ol>