Hi...
Usually we get country name by using our location via GPS settings. But somehow on situations we need to get country name without using GPS.
For these situation, Android provides Locale to get our device's country name.
We are using getResources() method
This is only one line code.
//getting current country name
String currentCountry;
currentCountry= getApplicationContext().getResources().getConfiguration().locale.getDisplayCountry();
0 Comment(s)