Recently in the function of making a currency exchange, which includes the acquisition and selection of currency units, collated out for your reference.
The individual currency unit files are as follows:
cny= RMB (CNY)
usd= US dollar (USD)
rub= Russian ruble (RUB)
hkd= Hong Kong Dollar (HKD)
Eur= EUR (EUR)
Jpy= Yen (JPY)
Krw= won (KRW)
gbp= Pound Sterling (GBP)
mop= Macau Dollar (MOP)
TWD twd= (TWD)
sgd= Singapore Dollar (SGD)
thb= Thai baht (THB)
chf= CHF (CHF)
aud= AUD (AUD)
aed= United Arab Emirates dirham (AED)
All= Albanian leks (All)
ars= Argentine peso (ARS)
awg= Aruba I. Florin (AWG)
dzd= Algerian dinar (DZD)
eek= Estonia Karenni (EEK)
egp= Egyptian pound (EGP)
etb= Ethiopian birr (ETB)
Omr= rial (OMR)
bbd= Barbados yuan (BBD)
Bgn= Bulgaria lev (BGN)
bhd= Bahraini dinar (BHD)
bif= Burundian franc (BIF)
bmd= Bermuda Daewon (BMD)
bob= Bolivian Nova (BOB)
Brl= Brazilian Real (BRL)
bsd= Bahamian Dollar (BSD)
btn= Bhutanese Rupee (BTN)
bwp= Botswana Pula (BWP)
Byr= Belarusian ruble (BYR)
bzd= Belize yuan (BZD)
isk= Icelandic krona (ISK)
pab= Panama Balboa (PAB)
pgk= Papua New Guinea (PGK)
pkr= Pakistani Rupee (PKR)
pln= Polish zloty (PLN)
pyg= Paraguayan Guaraní (PYG)
Kpw= Korean Won (KPW)
Dem= deutsche Mark (DEM)
dkk= Danish krone (DKK)
dop= Dominican peso (DOP)
xof= Togo African CFA franc (XOF)
ecs= Ecuador sucre (ECS)
ern= Eritrea (ERN)
cve= Cape Verde escudo (CVE)
fjd= Fijian dollar (FJD)
fkp= Falkland Is. pound (FKP)
frf= Franc (FRF)
php= Philippine peso (PHP)
cop= Colombian peso (COP)
crc= Costa Rican colon (CRC)
cup= Cuban Peso (CUP)
gmd= Gambian Dalasi (GMD)
gyd= Guyanese Dollar (GYD)
xaf= Congolese CFA franc (XAF)
xcd= Grenada East Caribbean Dollar (XCD)
hnl= Honduran Lempira (HNL)
htg= Haiti (HTG)
kzt= Kazakhstan tenge (KZT)
cad= Canadian Dollar (CAD)
czk= Czech koruna (CZK)
djf= Djibouti Franc (DJF)
ghc= Ghana cedi (GHC)
Gnf= Guinean franc (GNF)
Khr= Cambodian riel (KHR)
zwd= Zimbabwean dollar (ZWD)
hrk= Croatian kuna (HRK)
kes= Kenyan shilling (KES)
kmf= Comoros Franc (KMF)
kwd= Kuwaiti dinar (KWD)
Kyd= Cayman Islands (KYD)
Qar= Katallir (QAR)
Ang= Antilles Dutch guilder (ANG)
Lak= Lao Kip (LAK)
lbp= Lebanese pound (LBP)
lrd= Liberian dollar (LRD)
Lsl= Lesotholotti (LSL)
Ltl= Lithuanian Brienne (LTL)
lvl= Latvian lats (LVL)
lyd= Libyan dinar (LYD)
rol= Romanian Leu (ROL)
ron= Romanian new Leu (RON)
rwf= Rwandan franc (RWF)
bdt= Bengal Tower (BDT)
mad= Moroccan Road RAM (MAD)
Mdl= Moldovan Leu (MDL)
mgf= Malagasy franc (MGF)
mkd= Macedonian dinar (MKD)
mmk= Burmese Yuan (MMK)
Mnt= Mongolia (MNT)
mro= Mauritania (MRO)
mtl= Maltese lira (MTL)
mur= Mauritian Rupee (MUR)
Mvr=, Rufinamide, Maldives (MVR)
mwk= Malawian kwacha (MWK)
mxn= Mexican Peso (MXN)
myr= Malaysian Ringgit (MYR)
mzm= Mozambique (MZM)
pen= Peruvian Sol (PEN)
nad= Namibian Dollar (NAD)
ngn= Nigerian Naira (NGN)
nio= Nicaraguan Branch (NIO)
nok= Norwegian krone (NOK)
npr= Nepalese Rupee (NPR)
zar= South African rand (ZAR)
sek= Swedish krona (SEK)
csd= Serbian dinar (CSD)
cyp= Cyprus pound (CYP)
lkr= Sri Lankan Rupee (LKR)
sar= Saudi Riyal (SAR)
sbd= Solomon Islander Dollar (SBD)
Scr= Seychelles Franc (SCR)
Sdd= Sudanese dinar (SDD)
sdp= Sudanese pound (SDP)
Shp= St. Helena pound (SHP)
sit= Slovenian Toradev (SIT)
skk= Slovak koruna (SKK)
Sll= Sierra Leonean Leone (SLL)
sos= Somalia Shilling (SOS)
srg= Suriname guilder (SRG)
std= Saint-Dobra (STD)
svc= Salvadoran colon (SVC)
Szl= Swaziland, Guinea (SZL)
Wst= Samoa Tara (WST)
tnd= Tunisian dinar (TND)
top= Tonga pa ' Anga (TOP)
try= Turkish new lira (TRY)
ttd= Trinidad And Tobago yuan (TTD)
tzs= Tanzanian shilling (TZS)
xpf= CFP Franc (XPF)
bnd= Brunei Dollar (BND)
gtq= Guatemalan Quetzal (GTQ)
Uah= Ukraine Hryvnia (UAH)
ugs= Ugandan shilling (UGS)
uyu= Uruguay new Peso (UYU)
veb= Venezuelan Bolivar (VEB)
vuv= Vanuatu Vatu (VUV)
huf= Hungarian forint (HUF)
nzd= New Zealand dollar (NZD)
syp= Syrian pound (SYP)
zwn= New Zimbabwean dollar (ZWN)
idr= Indonesian rupiah (IDR)
ils= Israeli pound (ILS)
inr= Indian Rupee (INR)
iqd= Iraqi dinar (IQD)
Irr= Iranian riyal (IRR)
itl= Italian lira (ITL)
jmd= Jamaican Dollar (JMD)
jod= Jordanian dinar (JOD)
Vnd= Vietnamese dong (VND)
yer= Yemeni riyal (YER)
clp= Chilean peso (CLP)
gip= Gibraltar pound (GIP)
zmk= Zambian kwacha (ZMK)
The main code is as follows:
Xmlresourceparser Xmlresourceparser = Context.getresources (). GETXML (R.xml.currency_unit);
try {
while (Xmlresourceparser.geteventtype ()! = xmlpullparser.end_document) {
if (xmlresourceparser.geteventtype () = = Xmlpullparser.start_tag) {
String name = Xmlresourceparser.getname ();
if (name.equals ("unit")) {
Xmlresourceparser.next ();
if (xmlresourceparser.geteventtype () = = Xmlpullparser.text) {
string[] Text = Xmlresourceparser.gettext (). Split ("=");
}
}
}
Xmlresourceparser.next ();
}
} catch (Xmlpullparserexception e) {
E.printstacktrace ();
} catch (IOException e) {
E.printstacktrace ();
}
TEXT[0]=CNY;
Text[1]= CNY (CNY);
Android Currency Unit acquisition method