<s>[INST] How can implement network country detection on android? I am using Kotlin. [/INST] There are multiple implementation for detecting the country on android using kotlin. But by far the most simple way to do it is with this line of code:

String country = context.getResources().getConfiguration().locale.getCountry();</s>\ <s>[INST] What versions of Android does this work for? [/INST] This code will work on versions of Android since API level 8 (Android 2.2 Froyo).</s>