How can I get Country code of my sim in android code. I have used
TelephonyManager tm = (TelephonyManager)getSystemService(getApplicationContext().TELEPHONY
Actually libphonenumber is more convenient and is maintained:
PhoneNumberUtil.createInstance(getContext())getCountryCodeForRegion(countryNameCode)
For Android instead of using the Google library this one seems to be more lightweight: https://github.com/MichaelRocks/libphonenumber-android