What is the best way to get the country code?
As of now, I know two ways. One is to get by TelephonyManager and another by Locale. Which is another best and unique wa
It's very hard to find the country without GPS and Google Services (China). TelephonyManager won't work if there isn't any SIM card in your phone.
And Locale won't work if a user in China set his/her language as English (the country you will be getting will be US or UK).
If your app requires an Internet connection then there is an option. You could use this API called ip-api. Please go through their documentation first if you are planing to use this.
There are other APIs like this freegeoip API.