Closed openrijal closed 8 years ago
Hey, thanks for your feedback.
I will keep this list simple, so, no additional data except country codes and names. But we can run separate project for calling codes.
I will add string-array format for Android XML ;)
What is better:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="countries">
<item iso="AF">Afghanistan</item>
<item iso="AL">Albania</item>
</string-array>
</resources>
or:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="AF">Afghanistan</string>
<string name="AL">Albania</string>
</resources>
?
Because with 2nd format, you can directly access country by iso code, right?
I guess the first one is better to use.
Android resource XML would be great! Not sure which of two options is better, but you have a point that the 2nd format is probably more efficient. With the first format the whole array must be loaded just to get one string.
Perhaps, for format#2, you could prefix the resource names to prevent name clash, e.g use name="cc_AF" rather than just "AF".
This is a very good resource. It can be used for Registration forms and other purposes. It would be very good, if the country calling codes could be as well added to this list.
Moreover, a string-array format for Android XML would be very good as well.