Android Question (solved)how to get country code in B4A?

Maodge

Member
Licensed User
hello,
how to get country code in B4A, and which lib should i use? I want use this parameter for automatic selection of language.
thanks.
 

klaus

Expert
Licensed User
Longtime User
You can use the AHLocale library.
And with this code:
B4X:
Private AHL As AHLocale
AHL.Initialize
Log(AHL.DisplayCountry)
Log(AHL.Country)
DisplayCountry returns the full country name, 'Suisse' in my case, french language setting.
Country returns the country code, 'CH' in my case
 
Upvote 0
Top