Android Question Country identification

hookshy

Well-Known Member
Licensed User
Longtime User
How can I detect the country of the device ! I want to disable rate button for a naughty country that votes only 2,3stars in spite of other countries that are more generous and votes 4 and 5 stars.
 

hookshy

Well-Known Member
Licensed User
Longtime User
B4X:
Sub Activity_Create(FirstTime As Boolean)
  Log(GetDefaultLanguage)
End Sub

Sub GetDefaultLanguage As String
  Dim r As Reflector
  r.Target = r.RunStaticMethod("java.util.Locale", "getDefault", Null, Null)
  Return r.RunMethod("getDisplayName")
End Sub
Hey hookshy check this code
 
Upvote 0

JOANORSKY

Member
Licensed User
Longtime User
does someone know were to find language code ?
is the language code same as country ?
This would be interesting.. not to use the extended description but only the language code such as ES, US, PT, FR, DE, etc..

... did you found out how to do it?
 
Upvote 0
Top