GetCountryCode
GetCountryCode
An open source library developed for getting the country code of users android mobile.
Change dependencies library
- countrycode.
- countrycodesadapter
Dependencies library usage
Step 1
Gradle
dependencies {
compile 'com.minimumstack.amit_upadhyay_it.datastructure:countrycode:0.0.0'
compile 'com.minimumstack.amit_upadhyay_it.adapter:countrycodesadapter:0.0.0'
}
Step 2 –Class
new CountryCodesAdapter()
new CountryCodesWithDropDowmAdapter();
setAdapter(new CountryCodesAdapter());
setAdapter(new CountryCodesWithDropDowmAdapter());
Step 2 –extends Class
public class YourCountryCodesAdapter extends AbstractCountryCodesAdapter{
public YourCountryCodesAdapter() {
super();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
....balabala
}
}
Example Pic
Use
compile 'com.googlecode.libphonenumber:libphonenumber:8.0.1'
depencency.
This makes task easy and provide accurate result because its by google https://github.com/googlei18n/libphonenumber