21 Stimmen

Android string-array mit allen Ländern in verschiedenen Sprachen

Ich habe nach dieser Ressource gegoogelt, konnte aber nichts in der Fliege finden. Weiß jemand, wo ich eine Liste aller Länder der Welt in diesem Format und in verschiedenen Sprachen finden kann?

Gibt es einen Ort, an dem ich diese Informationen finden kann?

    <string-array name="countries_array">
        <item>Australia</item>
        <item>Belgium</item>
        <item>Cameroon</item>
        <item>Denmark</item>
        <item>(...)</item>  

    </string-array>

Dankeschön

0 Stimmen

Diese Beitrag könnte Ihnen helfen

0 Stimmen

Beachten Sie, dass es keinen Konsens darüber gibt, was ein Land ist und was nicht, so dass es unmöglich ist, eine vollständige Liste zu erstellen.

116voto

MobileCushion Punkte 6975

Ich habe eine schöne Liste in englischer Sprache gefunden. Ich lasse sie hier, für den Fall, dass sie in Zukunft jemand braucht. Ich werde versuchen, sie in anderen Sprachen zu finden, oder versuchen, sie zu konstruieren...

Wenn es nicht üblich ist, sie hier zu veröffentlichen, werde ich sie irgendwo speichern und einen Link posten.

Dankeschön

 <string-array name="countries_array">
    <item>Afghanistan</item>
    <item>Albania</item>
    <item>Algeria</item>
    <item>American Samoa</item>
    <item>Andorra</item>
    <item>Angola</item>
    <item>Anguilla</item>
    <item>Antarctica</item>
    <item>Antigua and Barbuda</item>
    <item>Argentina</item>
    <item>Armenia</item>
    <item>Aruba</item>
    <item>Australia</item>
    <item>Austria</item>
    <item>Azerbaijan</item>
    <item>Bahrain</item>
    <item>Bangladesh</item>
    <item>Barbados</item>
    <item>Belarus</item>
    <item>Belgium</item>
    <item>Belize</item>
    <item>Benin</item>
    <item>Bermuda</item>
    <item>Bhutan</item>
    <item>Bolivia</item>
    <item>Bosnia and Herzegovina</item>
    <item>Botswana</item>
    <item>Bouvet Island</item>
    <item>Brazil</item>
    <item>British Indian Ocean Territory</item>
    <item>British Virgin Islands</item>
    <item>Brunei</item>
    <item>Bulgaria</item>
    <item>Burkina Faso</item>
    <item>Burundi</item>
    <item>Cambodia</item>
    <item>Cameroon</item>
    <item>Canada</item>
    <item>Cape Verde</item>
    <item>Cayman Islands</item>
    <item>Central African Republic</item>
    <item>Chad</item>
    <item>Chile</item>
    <item>China</item>
    <item>Christmas Island</item>
    <item>Cocos (Keeling) Islands</item>
    <item>Colombia</item>
    <item>Comoros</item>
    <item>Congo</item>
    <item>Cook Islands</item>
    <item>Costa Rica</item>
    <item>Cote d\'Ivoire</item>
    <item>Croatia</item>
    <item>Cuba</item>
    <item>Cyprus</item>
    <item>Czech Republic</item>
    <item>Democratic Republic of the Congo</item>
    <item>Denmark</item>
    <item>Djibouti</item>
    <item>Dominica</item>
    <item>Dominican Republic</item>
    <item>East Timor</item>
    <item>Ecuador</item>
    <item>Egypt</item>
    <item>El Salvador</item>
    <item>Equatorial Guinea</item>
    <item>Eritrea</item>
    <item>Estonia</item>
    <item>Ethiopia</item>
    <item>Faeroe Islands</item>
    <item>Falkland Islands</item>
    <item>Fiji</item>
    <item>Finland</item>
    <item>Former Yugoslav Republic of Macedonia</item>
    <item>France</item>
    <item>French Guiana</item>
    <item>French Polynesia</item>
    <item>French Southern Territories</item>
    <item>Gabon</item>
    <item>Georgia</item>
    <item>Germany</item>
    <item>Ghana</item>
    <item>Gibraltar</item>
    <item>Greece</item>
    <item>Greenland</item>
    <item>Grenada</item>
    <item>Guadeloupe</item>
    <item>Guam</item>
    <item>Guatemala</item>
    <item>Guinea</item>
    <item>Guinea-Bissau</item>
    <item>Guyana</item>
    <item>Haiti</item>
    <item>Heard Island and McDonald Islands</item>
    <item>Honduras</item>
    <item>Hong Kong</item>
    <item>Hungary</item>
    <item>Iceland</item>
    <item>India</item>
    <item>Indonesia</item>
    <item>Iran</item>
    <item>Iraq</item>
    <item>Ireland</item>
    <item>Israel</item>
    <item>Italy</item>
    <item>Jamaica</item>
    <item>Japan</item>
    <item>Jordan</item>
    <item>Kazakhstan</item>
    <item>Kenya</item>
    <item>Kiribati</item>
    <item>Kuwait</item>
    <item>Kyrgyzstan</item>
    <item>Laos</item>
    <item>Latvia</item>
    <item>Lebanon</item>
    <item>Lesotho</item>
    <item>Liberia</item>
    <item>Libya</item>
    <item>Liechtenstein</item>
    <item>Lithuania</item>
    <item>Luxembourg</item>
    <item>Macau</item>
    <item>Madagascar</item>
    <item>Malawi</item>
    <item>Malaysia</item>
    <item>Maldives</item>
    <item>Mali</item>
    <item>Malta</item>
    <item>Marshall Islands</item>
    <item>Martinique</item>
    <item>Mauritania</item>
    <item>Mauritius</item>
    <item>Mayotte</item>
    <item>Mexico</item>
    <item>Micronesia</item>
    <item>Moldova</item>
    <item>Monaco</item>
    <item>Mongolia</item>
    <item>Montenegro</item>
    <item>Montserrat</item>
    <item>Morocco</item>
    <item>Mozambique</item>
    <item>Myanmar</item>
    <item>Namibia</item>
    <item>Nauru</item>
    <item>Nepal</item>
    <item>Netherlands</item>
    <item>Netherlands Antilles</item>
    <item>New Caledonia</item>
    <item>New Zealand</item>
    <item>Nicaragua</item>
    <item>Niger</item>
    <item>Nigeria</item>
    <item>Niue</item>
    <item>Norfolk Island</item>
    <item>North Korea</item>
    <item>Northern Marianas</item>
    <item>Norway</item>
    <item>Oman</item>
    <item>Pakistan</item>
    <item>Palau</item>
    <item>Panama</item>
    <item>Papua New Guinea</item>
    <item>Paraguay</item>
    <item>Peru</item>
    <item>Philippines</item>
    <item>Pitcairn Islands</item>
    <item>Poland</item>
    <item>Portugal</item>
    <item>Puerto Rico</item>
    <item>Qatar</item>
    <item>Reunion</item>
    <item>Romania</item>
    <item>Russia</item>
    <item>Rwanda</item>
    <item>Sqo Tome and Principe</item>
    <item>Saint Helena</item>
    <item>Saint Kitts and Nevis</item>
    <item>Saint Lucia</item>
    <item>Saint Pierre and Miquelon</item>
    <item>Saint Vincent and the Grenadines</item>
    <item>Samoa</item>
    <item>San Marino</item>
    <item>Saudi Arabia</item>
    <item>Senegal</item>
    <item>Serbia</item>
    <item>Seychelles</item>
    <item>Sierra Leone</item>
    <item>Singapore</item>
    <item>Slovakia</item>
    <item>Slovenia</item>
    <item>Solomon Islands</item>
    <item>Somalia</item>
    <item>South Africa</item>
    <item>South Georgia and the South Sandwich Islands</item>
    <item>South Korea</item>
    <item>South Sudan</item>
    <item>Spain</item>
    <item>Sri Lanka</item>
    <item>Sudan</item>
    <item>Suriname</item>
    <item>Svalbard and Jan Mayen</item>
    <item>Swaziland</item>
    <item>Sweden</item>
    <item>Switzerland</item>
    <item>Syria</item>
    <item>Taiwan</item>
    <item>Tajikistan</item>
    <item>Tanzania</item>
    <item>Thailand</item>
    <item>The Bahamas</item>
    <item>The Gambia</item>
    <item>Togo</item>
    <item>Tokelau</item>
    <item>Tonga</item>
    <item>Trinidad and Tobago</item>
    <item>Tunisia</item>
    <item>Turkey</item>
    <item>Turkmenistan</item>
    <item>Turks and Caicos Islands</item>
    <item>Tuvalu</item>
    <item>Virgin Islands</item>
    <item>Uganda</item>
    <item>Ukraine</item>
    <item>United Arab Emirates</item>
    <item>United Kingdom</item>
    <item>United States</item>
    <item>United States Minor Outlying Islands</item>
    <item>Uruguay</item>
    <item>Uzbekistan</item>
    <item>Vanuatu</item>
    <item>Vatican City</item>
    <item>Venezuela</item>
    <item>Vietnam</item>
    <item>Wallis and Futuna</item>
    <item>Western Sahara</item>
    <item>Yemen</item>
    <item>Yugoslavia</item>
    <item>Zambia</item>
    <item>Zimbabwe</item>
 </string-array>

1 Stimmen

Diese Liste ist veraltet, sie enthält Jugoslawien, das es schon lange nicht mehr gibt.

0 Stimmen

Was passiert, wenn jemand in Ex-Jugoslawien geboren ist und die Papiere ausfüllt, wie würde er dann die Frage "In welchem Land sind Sie geboren?" beantworten?

0 Stimmen

Dies hat einige Ländercodes sind falsch zugeordnet überprüft unten gist gist.github.com/AJayBhimani74/c518431a2202ba8dac2bf5020c2fef‌​56

18voto

Aritra Roy Punkte 15120

Hier finden Sie eine aktualisierte Liste aller Länder der Welt.

<string-array name="countries_array">
    <item>Afghanistan</item>
    <item>Albania</item>
    <item>Algeria</item>
    <item>American Samoa</item>
    <item>Andorra</item>
    <item>Angola</item>
    <item>Anguilla</item>
    <item>Antarctica</item>
    <item>Antigua and Barbuda</item>
    <item>Argentina</item>
    <item>Armenia</item>
    <item>Aruba</item>
    <item>Australia</item>
    <item>Austria</item>
    <item>Azerbaijan</item>
    <item>Bahamas</item>
    <item>Bahrain</item>
    <item>Bangladesh</item>
    <item>Barbados</item>
    <item>Belarus</item>
    <item>Belgium</item>
    <item>Belize</item>
    <item>Benin</item>
    <item>Bermuda</item>
    <item>Bhutan</item>
    <item>Bolivia</item>
    <item>Bosnia and Herzegovina</item>
    <item>Botswana</item>
    <item>Brazil</item>
    <item>British Indian Ocean Territory</item>
    <item>British Virgin Islands</item>
    <item>Brunei</item>
    <item>Bulgaria</item>
    <item>Burkina Faso</item>
    <item>Burundi</item>
    <item>Cambodia</item>
    <item>Cameroon</item>
    <item>Canada</item>
    <item>Cape Verde</item>
    <item>Cayman Islands</item>
    <item>Central African Republic</item>
    <item>Chad</item>
    <item>Chile</item>
    <item>China</item>
    <item>Christmas Island</item>
    <item>Cocos Islands</item>
    <item>Colombia</item>
    <item>Comoros</item>
    <item>Cook Islands</item>
    <item>Costa Rica</item>
    <item>Croatia</item>
    <item>Cuba</item>
    <item>Cyprus</item>
    <item>Czech Republic</item>
    <item>Democratic Republic of the Congo</item>
    <item>Denmark</item>
    <item>Djibouti</item>
    <item>Dominica</item>
    <item>Dominican Republic</item>
    <item>East Timor</item>
    <item>Ecuador</item>
    <item>Egypt</item>
    <item>El Salvador</item>
    <item>Equatorial Guinea</item>
    <item>Eritrea</item>
    <item>Estonia</item>
    <item>Ethiopia</item>
    <item>Falkland Islands</item>
    <item>Faroe Islands</item>
    <item>Fiji</item>
    <item>Finland</item>
    <item>France</item>
    <item>French Polynesia</item>
    <item>Gabon</item>
    <item>Gambia</item>
    <item>Georgia</item>
    <item>Germany</item>
    <item>Ghana</item>
    <item>Gibraltar</item>
    <item>Greece</item>
    <item>Greenland</item>
    <item>Grenada</item>
    <item>Guam</item>
    <item>Guatemala</item>
    <item>Guinea</item>
    <item>Guinea-Bissau</item>
    <item>Guyana</item>
    <item>Haiti</item>
    <item>Honduras</item>
    <item>Hong Kong</item>
    <item>Hungary</item>
    <item>Iceland</item>
    <item>India</item>
    <item>Indonesia</item>
    <item>Iran</item>
    <item>Iraq</item>
    <item>Ireland</item>
    <item>Isle of Man</item>
    <item>Israel</item>
    <item>Italy</item>
    <item>Ivory Coast</item>
    <item>Jamaica</item>
    <item>Japan</item>
    <item>Jersey</item>
    <item>Jordan</item>
    <item>Kazakhstan</item>
    <item>Kenya</item>
    <item>Kiribati</item>
    <item>Kuwait</item>
    <item>Kyrgyzstan</item>
    <item>Laos</item>
    <item>Latvia</item>
    <item>Lebanon</item>
    <item>Lesotho</item>
    <item>Liberia</item>
    <item>Libya</item>
    <item>Liechtenstein</item>
    <item>Lithuania</item>
    <item>Luxembourg</item>
    <item>Macao</item>
    <item>Macedonia</item>
    <item>Madagascar</item>
    <item>Malawi</item>
    <item>Malaysia</item>
    <item>Maldives</item>
    <item>Mali</item>
    <item>Malta</item>
    <item>Marshall Islands</item>
    <item>Mauritania</item>
    <item>Mauritius</item>
    <item>Mayotte</item>
    <item>Mexico</item>
    <item>Micronesia</item>
    <item>Moldova</item>
    <item>Monaco</item>
    <item>Mongolia</item>
    <item>Montenegro</item>
    <item>Montserrat</item>
    <item>Morocco</item>
    <item>Mozambique</item>
    <item>Myanmar</item>
    <item>Namibia</item>
    <item>Nauru</item>
    <item>Nepal</item>
    <item>Netherlands</item>
    <item>Netherlands Antilles</item>
    <item>New Caledonia</item>
    <item>New Zealand</item>
    <item>Nicaragua</item>
    <item>Niger</item>
    <item>Nigeria</item>
    <item>Niue</item>
    <item>North Korea</item>
    <item>Northern Mariana Islands</item>
    <item>Norway</item>
    <item>Oman</item>
    <item>Pakistan</item>
    <item>Palau</item>
    <item>Panama</item>
    <item>Papua New Guinea</item>
    <item>Paraguay</item>
    <item>Peru</item>
    <item>Philippines</item>
    <item>Pitcairn</item>
    <item>Poland</item>
    <item>Portugal</item>
    <item>Puerto Rico</item>
    <item>Qatar</item>
    <item>Republic of the Congo</item>
    <item>Romania</item>
    <item>Russia</item>
    <item>Rwanda</item>
    <item>Saint Barthelemy</item>
    <item>Saint Helena</item>
    <item>Saint Kitts and Nevis</item>
    <item>Saint Lucia</item>
    <item>Saint Martin</item>
    <item>Saint Pierre and Miquelon</item>
    <item>Saint Vincent and the Grenadines</item>
    <item>Samoa</item>
    <item>San Marino</item>
    <item>Sao Tome and Principe</item>
    <item>Saudi Arabia</item>
    <item>Senegal</item>
    <item>Serbia</item>
    <item>Seychelles</item>
    <item>Sierra Leone</item>
    <item>Singapore</item>
    <item>Slovakia</item>
    <item>Slovenia</item>
    <item>Solomon Islands</item>
    <item>Somalia</item>
    <item>South Africa</item>
    <item>South Georgia and the South Sandwich Islands</item>
    <item>South Korea</item>
    <item>Spain</item>
    <item>Sri Lanka</item>
    <item>Sudan</item>
    <item>Suriname</item>
    <item>Svalbard and Jan Mayen</item>
    <item>Swaziland</item>
    <item>Sweden</item>
    <item>Switzerland</item>
    <item>Syria</item>
    <item>Taiwan</item>
    <item>Tajikistan</item>
    <item>Tanzania</item>
    <item>Thailand</item>
    <item>Togo</item>
    <item>Tokelau</item>
    <item>Tonga</item>
    <item>Trinidad and Tobago</item>
    <item>Tunisia</item>
    <item>Turkey</item>
    <item>Turkmenistan</item>
    <item>Turks and Caicos Islands</item>
    <item>Tuvalu</item>
    <item>U.S. Virgin Islands</item>
    <item>Uganda</item>
    <item>Ukraine</item>
    <item>United Arab Emirates</item>
    <item>United Kingdom</item>
    <item>United States</item>
    <item>Uruguay</item>
    <item>Uzbekistan</item>
    <item>Vanuatu</item>
    <item>Vatican</item>
    <item>Venezuela</item>
    <item>Vietnam</item>
    <item>Wallis and Futuna</item>
    <item>Western Sahara</item>
    <item>Yemen</item>
    <item>Zambia</item>
    <item>Zimbabwe</item>
</string-array>

7voto

Samir Punkte 5905

Für den Fall, dass das String-Array-Format benötigt wird.

 String[] countries = new String[]{"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla",
            "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas",
            "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia",
            "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam",
            "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands",
            "Central African Republic", "Chad", "Chile", "China, People's republic of", "Christmas Island", "Cocos (Keeling) Islands", "Colombia",
            "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire",
            "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic",
            "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia",
            "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "France Metropolitan", "French Guiana",
            "French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar",
            "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti",
            "Heard and Mc Donald Islands", "Holy See (Vatican City State)", "Honduras", "Hong Kong", "Hungary", "Iceland", "India",
            "Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan",
            "Kazakhstan", "Kenya", "Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kosovo", "Kuwait",
            "Kyrgyzstan", "Lao, People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya",
            "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia, The Former Yugoslav Republic of", "Madagascar",
            "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius",
            "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of", "Monaco", "Mongolia", "Montserrat",
            "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles",
            "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands",
            "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Palestine", "Peru", "Philippines", "Pitcairn",
            "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda",
            "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino",
            "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Seychelles", "Sierra Leone", "Singapore",
            "Slovakia (Slovak Republic)", "Slovenia", "Solomon Islands", "Somalia", "South Africa",
            "South Georgia and the South Sandwich Islands", "Spain", "Sri Lanka", "St. Helena", "St. Pierre and Miquelon",
            "Sudan", "Suriname", "Svalbard and Jan Mayen Islands", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic",
            "Taiwan", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Tibet", "Togo", "Tokelau", "Tonga",
            "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine",
            "United Arab Emirates", "United Kingdom", "United States", "United States Minor Outlying Islands", "Uruguay",
            "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (U.S.)",
            "Wallis and Futuna Islands", "Western Sahara", "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"};

1voto

Vinayak Bevinakatti Punkte 39533

0 Stimmen

Danke, das sind wirklich tolle Artikel! Sie könnten sich als nützlich erweisen!

1voto

thanhbinh84 Punkte 16430

Falls Sie den Ländercode des Paares benötigen - Name. Dies könnte hilfreich sein:
Quelle

import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;

public class CountryList {
    public static List<Country> get() {
        // A collection to store our country object
        List<Country> countries = new ArrayList<Country>();

        // Get ISO countries, create Country object and
        // store in the collection.
        String[] isoCountries = Locale.getISOCountries();
        for (String country : isoCountries) {
            Locale locale = new Locale("en", country);
            String iso = locale.getISO3Country();
            String code = locale.getCountry();
            String name = locale.getDisplayCountry();

            if (!"".equals(iso) && !"".equals(code) && !"".equals(name)) {
                countries.add(new Country(iso, code, name));
            }
        }

        // Sort the country by their name and then display the content
        // of countries collection object.
        Collections.sort(countries, new CountryComparator());
        return countries;
    }

    /**
     * Country pojo class.
     */
    public static class Country {
        private String iso;
        private String code;
        private String name;

        Country(String iso, String code, String name) {
            this.iso = iso;
            this.code = code;
            this.name = name;
        }

        public String toString() {
            return iso + " - " + code + " - " + name.toUpperCase();
        }
    }

    /**
     * CountryComparator class.
     */
    private static class CountryComparator implements Comparator<Country> {
        private Comparator<Object> comparator;

        CountryComparator() {
            comparator = Collator.getInstance();
        }

        public int compare(Country c1, Country c2) {
            return comparator.compare(c1.name, c2.name);
        }
    }
}

CodeJaeger.com

CodeJaeger ist eine Gemeinschaft für Programmierer, die täglich Hilfe erhalten..
Wir haben viele Inhalte, und Sie können auch Ihre eigenen Fragen stellen oder die Fragen anderer Leute lösen.

Powered by:

X