Android Question How to get phone's 2-letter country code

toby

Well-Known Member
Licensed User
Longtime User
AHLocal library can give me the 3-letter country code while I need the 2-letter one. Is there any easy way to get it or to convert 3-letter to 2-letter one?

TIA

Country2-letter country code3-letter country code
AustraliaAUAUS
CanadaCACAN
New ZealandNZNZL
United KingdomUKGBR
United StatesUSUSA
AustriaATAUT
 
Solution
Try this:
1659565617467.png

Country Codes:
    Dim r As Reflector
    r.Target = r.RunStaticMethod("java.util.Locale", "getDefault", Null, Null)
    Log(r.RunMethod("getCountry"))

MicroDrie

Well-Known Member
Licensed User
Longtime User
Try this:
1659565617467.png

Country Codes:
    Dim r As Reflector
    r.Target = r.RunStaticMethod("java.util.Locale", "getDefault", Null, Null)
    Log(r.RunMethod("getCountry"))
 
Upvote 1
Solution
Top