Does your application needs user's country information? Do you want to have information of all countries up and running in less than 2 minutes? Do you want to pick user's ISO Code? Do you want to pick user's ISD Code? Do you want to have user's Flag of Country?
If any (or all) of these questions seem familiar, the Country Utility is the perfect library for you all.
Never waste your time again string all countries information in yoor database. It provides you with the available countries across the globe with thier basic information required while signup with your application. Customizations are also available w.r.t. your application theme. It provide custom colors, custom themes, ... No limits for customizations.
- the easiest possible integration
- integrate in less than 2 minutes
- compatible down to API Level 15
- get you Database of all Countries
- get you the Country Flag
- get you the Country ISO Code
- get you the Country ISD Code
Countryutility is a simple library that enables you to pick a country while signing up or get the details of a country i.e Name, Flad, ISO Code and ISD code.
Step 1. Add the JitPack repository to your projects's(root) build.gradle file at the end of repositories:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Step 2. Add the dependency in your app's build.gradle file.
dependencies {
compile 'com.github.jitenderdev:countryutility:v1.1'
}
new CountryUtil(this).setTitle("Select Country").build();
You can keep the title empty the default title is 'All Countries'
new CountryUtil(this).build();
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == Constants.KEY_RESULT_CODE) {
try {
mTvCountryName.setText(data.getStringExtra(Constants.KEY_COUNTRY_NAME));
mTvCountryIsoCode.setText(data.getStringExtra(Constants.KEY_COUNTRY_ISO_CODE));
mTvCountryDialCode.setText(data.getStringExtra(Constants.KEY_COUNTRY_ISD_CODE));
mIvCountryFlag.setImageResource(data.getIntExtra(Constants.KEY_COUNTRY_FLAG, 0));
} catch (Exception e) {
e.printStackTrace();
}
}
}
Great. Your Country Utility Library is now ready to use.
Customize your theme. Add below colors in your colors.xml
<color name="countryColorPrimary">#0FBA0A</color>
<color name="countryColorPrimaryDark">#41890B</color>
<color name="countryColorAccent">#0B1A89</color>
Your activity will be custimized with above color theme.