Android 10以下では、次のKotlinコードを使用できます
`` `
val fusedlocationclient = locationservices.getFusedlocationProviderClient（This）
fusedlocationclient.lastlocation
    .addonsuccesslistener {location：location？ - >
        ValGeoCoder = GeoCoder（this、locale.getDefault（））
        valアドレス= geocoder.getFromLocation（場所!!。緯度、location.longitude、1）
        val CountryCode = Addresses [0] .CountryCode
    }
`` `
On Android 10 or newer you can use the following Kotlin code
```
val fusedLocationClient = LocationServices.getFusedLocationProviderClient(this)
fusedLocationClient.lastLocation
    .addOnSuccessListener { location: Location? ->
        val geocoder = Geocoder(this, Locale.getDefault())
        val addresses = geocoder.getFromLocation(location!!.latitude, location.longitude, 1)
        val countryCode = addresses[0].countryCode
    }
```