diff --git a/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java b/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java
index c47abe0..58b3df8 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,8 @@
                 .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 +1188,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;
+   }
 }
