Country Code Picker for Android Phone Forms
Country Code Picker (CCP) is an android library which provides an easy way to search and select country or international phone code. Also supports Android EditText phone mask and international phone validation.
At a glance
- What is it?
- Country Code Picker is an Android Java library for searching and selecting a country or calling code, with optional phone formatting and validation. It suits international phone forms, but its integration instructions depend on linked wiki pages.
- Who is it for?
- Android teams building forms around international phone numbers should inspect this library if they want an existing country picker rather than a full-screen country list. Teams that need a fully documented local integration path or a Compose-first API should verify those requirements first.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 56 days ago.
- What is it written in?
- Mainly Java, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 20, 2026, and from our analysis. They are not legal advice.
Editorial analysis
Why Country Code Picker Exists in Android Forms
Country Code Picker, abbreviated CCP in the README, addresses a narrow but common Android form problem: users need to identify a country and enter the rest of a telephone number without guessing how the international calling code should be represented. It is aimed at developers adding login, registration, profile, or similar forms where a raw numeric field does not explain whether the number is domestic, international, or tied to a particular country.
The library provides two visible uses. It can act as a country selector or country spinner, or it can serve as a phone-code picker associated with a telephone input. Tapping the control opens a dialog in which the user searches for and selects a country. This is more focused than a general address-form component because its country list and selection logic are tied to telephone numbers.
CCP also advertises full-number support. Its feature list includes automatic formatting, number validation, a validity-change listener, and reading or loading a full number. These capabilities make it relevant to forms that need to react to whether the entered number is valid, rather than only collecting a country name. The README does not describe handling of extensions, emergency numbers, non-geographic calling codes, or every numbering-plan edge case, so an international telephony product would need to confirm those boundaries separately.
Country Selection and Phone Validation in CCP
The documented interaction is dialog based. A user taps the CCP view, searches or scrolls through countries, and chooses one. The selected country can then determine the phone code shown with the telephone input. The README also lists a fast scroller, which is useful when the full country list is long and the user knows the beginning of a country name.
The full-number feature set connects the picker to phone-number handling rather than treating country choice as an isolated label. The feature list names automatic formatting, validation, and a validity-change listener. This means an application can receive validity state changes, although the README excerpt does not include the listener signature or lifecycle rules. The project credits an optimized Android port of libphonenumber and separately credits recycler-fast-scroll. Those credits identify the foundations named by the project, but the README does not document the internal call sequence or public phone-number parsing API.
CCP can remember the last selection and can detect a country. The README also advertises automatic language detection, country preference, and support for a custom master country list. These controls matter when an application has a known user market or must present a restricted list. Based on the documented feature set, the control can be useful both for a broad international audience and for forms limited to selected operating regions. The precise XML keys and their accepted values are not present in the README and are delegated to the XML Properties wiki.
Gradle Installation and the First Integration Check
The README says to add the library to the Gradle dependency block and synchronize. The latest release named in the repository is v2.7.0, so the dependency below uses that release name. The README documents the general declaration and points to CHANGELOG.md for detailed changes.
dependencies {
implementation 'com.hbb20:ccp:X.Y.Z'
}After adding the declaration, synchronize the Android Gradle project so the dependency can be resolved. Version 2.3.1 and above uses AndroidX, and version 2.5.0 and above is hosted on Maven Central. Projects older than version 2.0.0 are directed to a separate v2.0.0 update guide, which matters because the project explicitly identifies that upgrade boundary.
The README does not include the actual XML view declaration, Java activity code, or listener registration needed for a complete first phone-form example. Those details are sent to the linked integration wiki. This omission matters for evaluation because a dependency declaration shows only how to obtain the artifact, not how the public API behaves in a particular layout. The first integration check should therefore consist of consulting that wiki, choosing either the country-selector mode or the phone-code mode, and confirming that the referenced attributes match the exact library version. The repository also contains an `app/` directory and a demonstration application, but the README excerpt does not document the commands required to build and run that example.
XML Customization Boundaries for CCP Dialogs
CCP advertises customization at two levels: the main CCP theme and the selection dialog theme. It also points to an XML Properties page for available configuration. That is useful for applications with a defined Android design system because country lists, picker colors, flag appearance, and dialog presentation can create application-specific inconsistencies when left at defaults.
The README confirms only a small part of the property surface. Its fast-scroller link explicitly references `appccp_dialog_showfastscroller` with a default of `true`, while its language and selection links reference `appccp_autodetectlanguagetrue-default--false-` and `appccp_rememberlastselectiontrue-default--false-`. These wiki links are references rather than complete property documentation within the README.
The distinction between theme and functional properties is important. A theme changes presentation, while options such as remembering the last selection or supplying a custom country list affect application behavior and state. Integrators should not infer valid types, scope, or default behavior from a property name alone. The project also supports country-selection change listeners, but the README does not show when that callback fires or whether it is delivered for programmatic changes. The XML Properties and integration wiki pages are the first sources to consult for those details.
When CCP Is the Wrong Android Component
CCP is the wrong choice when country selection is not tied to an international telephone number. A signup form collecting nationality, shipping origin, tax jurisdiction, or billing country should not assume that a phone-code component carries the required semantics. The README describes the project around country or international phone code selection and phone-number formatting, so those broader localization cases lie outside its stated scope.
It may also be unsuitable for a project that requires the complete integration contract to be visible in local documentation. The README delegates setup details to wiki pages and does not show a first-use layout or Java snippet. That makes adoption less self-contained than a library whose main documentation includes the required views, lifecycle handling, and listener signatures.
A further boundary concerns numbering behavior. The project names formatting and validation, but the README does not state which countries, national formats, shared calling codes, or partial-number states are covered by the selected release. It also does not claim that entering a locally valid-looking number guarantees that the number is assigned or reachable. CCP can report what its validation layer considers valid; it does not document carrier activation checks or deliverability testing.
Non-Android applications are also outside the documented integration path. The repository identifies Java as its primary language and describes XML customization and AndroidX integration, so its documented components do not directly serve iOS, Flutter, React Native, server-side web forms, or backend normalization unless a separate integration layer exists. No such layer is documented in the README.
CountryCodePickerProject Compared With a Custom Picker
The clearest alternative is to build a custom country picker around the application's own country dataset and a separate international phone-number component. That approach changes the ownership boundary. With CCP, the application receives one library that combines a selectable country view, dialog search, phone-code selection, formatting, and validation. A custom implementation can choose each screen and parsing component independently, but the developer must handle the country list, filtering, selection state, formatting, and validation connections.
The tradeoff is documentation and integration depth. The README identifies multiple CCP capabilities and links each to a separate wiki topic, but it does not reproduce those examples. A custom implementation can place all choices and code in the repository, yet it also introduces more application code and more decisions about UI behavior. CCP reduces that surface by packaging the UI and phone-number behavior, although the documented setup remains distributed across project wiki pages.
There is no documented switch for replacing only the phone-code view while retaining CCP's other behavior. The country-selector and phone-code-picker modes are both advertised, but their exact configuration is not shown in the README. Teams that need a highly specific interaction or strict visual ownership may prefer custom components. Teams that mainly need the documented combination of country search, international code selection, formatting, and validation have fewer moving parts with CCP, provided they can follow the linked integration documentation.
License, Releases, and Upgrade Cost for Android Teams
Country Code Picker is distributed under the Apache-2.0 license. That permits use and modification under the license's stated conditions, but this review does not interpret those legal terms or assess an application's compliance. An adopting organization still needs to review the repository `License.txt` and preserve any notices required by the license.
The README points adopters to CHANGELOG.md for detailed changes. This matters because the project identifies a migration boundary at version 2.0.0, AndroidX support from version 2.3.1, and Maven Central hosting from version 2.5.0. A team moving from a pre-2.0.0 release has a documented update path to consider. A team on a newer release should still check the changelog before changing versions because the README excerpt does not list API changes between releases.
The latest named release is v2.7.0 from 2023-01-29, while the last push was on 2026-08-27. The repository is not archived. Repository activity continued after that release, but the dates do not establish whether a newer release is planned. The README also credits libphonenumber-related and fast-scroller work, which may carry separate upgrade considerations when the library updates its internals. The README does not state dependency versions or a compatibility matrix, so those details must be checked in the build files and release notes before upgrading.
Editorial conclusion
Android teams building forms around international phone numbers should inspect this library if they want an existing country picker rather than a full-screen country list. Teams that need a fully documented local integration path or a Compose-first API should verify those requirements first. Before adoption, open the integration and XML property wiki pages, confirm the API against the selected release, and review CHANGELOG.md because the latest named release is v2.7.0 while the last repository push was on 2026-08-27.
Frequently asked questions
How do I add Country Code Picker to an Android project?
The README says to add the `com.hbb20:ccp` artifact to the Gradle dependencies and synchronize. Version 2.5.0 and above is hosted on Maven Central, and the repository identifies v2.7.0 as the latest named release.
Does Country Code Picker format and validate international phone numbers?
Yes. The README lists automatic formatting, number validation, a validity-change listener, and support for reading or loading a full number. It does not provide the Java API examples for those operations.
Can Country Code Picker detect the user's country?
The feature list says CCP supports automatic country detection and automatic language detection. Country preference and remembering the last selection are also listed, with configuration details delegated to the project wiki.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/hbb20-countrycodepickerproject)