diff --git a/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java b/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java
index c47abe0..b84cf6e 100644
--- a/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java
+++ b/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java
@@ -82,6 +82,7 @@
    public static final int REGIONAL_BAND_UNITED_STATES   = 35;
    public static final int REGIONAL_BAND_USER_DEFINED    = 36;
    public static final int REGIONAL_BAND_INDONESIA       = 37;
+   // If you add to this list, add to getBand() below as well.
 
    public static final int RECORD_DUR_INDEX_0_VAL        = 5;
    public static final int RECORD_DUR_INDEX_1_VAL       = 15;
@@ -510,7 +511,7 @@
                 .getBoolean(R.bool.def_fm_country_location_enabled)) {
             setCountry(sp.getInt(FMCONFIG_COUNTRY, REGIONAL_BAND_INDIA));
       } else {
-          mDefaultCountryIndex = mContext.getResources().getInteger(R.integer.default_country_index);
+          mDefaultCountryIndex = getBand(mContext.getResources().getInteger(R.integer.default_country_index));
           setCountry(sp.getInt(FMCONFIG_COUNTRY, mDefaultCountryIndex));
       }
       /* Last list the user was navigating */
@@ -1186,4 +1187,75 @@
    public static boolean getAutoAFSwitch() {
       return mAFAutoSwitch;
    }
+
+   /**
+    * Map country code to radio band. If country code is not found
+    * in the list, takes the default from resources.
+    */
+   private static int getBand(int deflt) {
+      return getBand(Locale.getDefault().getCountry(), deflt);
+   }
+
+   private static int getBand(String country, int deflt) {
+      // The order of country codes in this list is very strict; it
+      // needs to exactly correspond to the REGIONAL_BAND definitions
+      // at the top of this file. That is why there are two "JP"
+      // entries, one of which is unreachable, and why there is a
+      // placeholder for REGIONAL_BAND_USER_DEFINED.
+      // Some of these entries are intelligent guesses, e.g. my
+      // research indicates that Geurnsey, Jersey, and the Isle of Man
+      // use the same standards as GB.
+      // Many, many countries are not listed. Those will receive the
+      // default setting specified in the resources file.
+      final String[][] countries = {
+         {"CA"},    // REGIONAL_BAND_NORTH_AMERICA
+         {"AL", "AD", "AM", "AZ", "BY", "BA", "BG", "HR", "CY", "EE",
+          "GE", "HU", "IS", "KZ", "LV", "LI", "LT", "LU", "MK", "MT",
+          "MD", "MC", "ME", "RO", "SM", "RS", "SK", "SI", "UA", "VA"}, // REGIONAL_BAND_EUROPE
+         {"JP"},    // REGIONAL_BAND_JAPAN
+         {"JP"},    // REGIONAL_BAND_JAPAN_WIDE (not reached)
+         {"AU"},    // REGIONAL_BAND_AUSTRALIA
+         {"AT"},    // REGIONAL_BAND_AUSTRIA
+         {"BE"},    // REGIONAL_BAND_BELGIUM
+         {"BR"},    // REGIONAL_BAND_BRAZIL
+         {"CN"},    // REGIONAL_BAND_CHINA
+         {"CZ"},    // REGIONAL_BAND_CZECH
+         {"DK"},    // REGIONAL_BAND_DENMARK
+         {"FI"},    // REGIONAL_BAND_FINLAND
+         {"FR"},    // REGIONAL_BAND_FRANCE
+         {"DE"},    // REGIONAL_BAND_GERMANY
+         {"GR"},    // REGIONAL_BAND_GREECE
+         {"HK"},    // REGIONAL_BAND_HONGKONG
+         {"IN"},    // REGIONAL_BAND_INDIA
+         {"IE"},    // REGIONAL_BAND_IRELAND
+         {"IT"},    // REGIONAL_BAND_ITALY
+         {"KR"},    // REGIONAL_BAND_KOREA
+         {"MX"},    // REGIONAL_BAND_MEXICO
+         {"NL"},    // REGIONAL_BAND_NETHERLANDS
+         {"NZ"},    // REGIONAL_BAND_NEWZEALAND
+         {"NO","IS"},    // REGIONAL_BAND_NORWAY
+         {"PL"},    // REGIONAL_BAND_POLAND
+         {"PT"},    // REGIONAL_BAND_PORTUGAL
+         {"RU"},    // REGIONAL_BAND_RUSSIA
+         {"SG"},    // REGIONAL_BAND_SINGAPORE
+         {"SK"},    // REGIONAL_BAND_SLOVAKIA
+         {"ES"},    // REGIONAL_BAND_SPAIN
+         {"CH"},    // REGIONAL_BAND_SWITZERLAND
+         {"SE"},    // REGIONAL_BAND_SWEDEN
+         {"TW"},    // REGIONAL_BAND_TAIWAN
+         {"TR"},    // REGIONAL_BAND_TURKEY
+         {"GB","GG","IM","JE"},    // REGIONAL_BAND_UNITEDKINGDOM
+         {"US"},    // REGIONAL_BAND_UNITED_STATES
+         {"--"},    // REGIONAL_BAND_USER_DEFINED (handled elsewhere)
+         {"ID"},    // REGIONAL_BAND_INDONESIA
+      };
+      for (int band = 0; band < countries.length; ++band) {
+         for (String cc : countries[band]) {
+            if (cc.equals(country)) {
+               return band;
+            }
+         }
+      }
+      return deflt;
+   }
 }
