Android Phones: Caller IDs, Contacts & Country Code Prefixes

Is your Android phone not associating Caller Idenfication (CID) with your contacts, due to country code prefixes?  Then this article is for you.

The Problem

Operators worldwide to do not adhere to a unified policy on including country code prefixes, in the caller ID string.

Below are some examples:

CID for Incoming Calls CID for Incoming SMS Texts
Maldives XXX XXXX +960 XXX XXXX
Sri Lanka (XXX) XXX-XXX +94 (XXX) XXX-XXX

Therefore, during an incoming call in home country, your phone only associates the CIDs with your contacts, only if there is an exact match in your contacts (i.e., if numbers are stored without country codes).  This is case is not true when you are roaming (when the CID includes a country code prefix)!

Recent unrooted Android 2.+ phones, scan for an exact match in your contacts and does not scan within the CID string.

Ideal Solution

Ideally there are two solutions to this problem.  Either operators always included the country code prefix or, the mobile phone (or its software) scanned within the CID string.

After some enlightening discussions with some friends, I realized that operators may not embrace a unified policy to include country code prefixes for branding reasons.  Furthermore, it would created a hassle to dial and read extra numbers for the majority of the population, who do not subscribe to roaming packages.

The next solution would be to wait for a firmware / software update, which may or may not include a fix to scan within the Caller ID string.

A Workable Hack

After some thought, I managed to work around this problem.  Here is what to do:

  1. Make a back-up of your Address Book (mac) and / or Google Contacts, should you have a need to roll back.
  2. Make sure you have all the phone numbers with the country code prefix in your Address Book (for mac) or in Google Contacts.  Spring clean your contacts for consistency.  Make sure you do not have two people with the same name!  If you do, insert a unique identifier.
  3. Export them to a Google Contacts friendly .csv (comma seperated values) text file.  AddressBook2CSV is a freeware to do just that on Mac OSX.
  4. With a decent text editor, use the FIND AND REPLACE ALL command to find all “+<country code>” prefixes and replace these with a null strings (“”).  That should strip-off the country code prefixes.  I used Bare Bones’ TextWrangler.
  5. Save your .csv file and import it back to your Google Contacts.  This should create duplicate contacts and your contacts count should double.
  6. Use Google Contacts’ FIND DUPLICATES (see image below) to find and merge duplicate contacts.  It should do a pretty good job provided your contacts are well organized, as by now, all the contacts’ details should be consistent, except for the country code prefix in one and none in last imported contacts.


What this effectively does is that for each phone number of each contact, you would have two phone numbers, one with the country code prefix and one without.

This way, whether you receive your CID with the country code prefix (such as SMS Texts and incoming calls while roaming) or receive incoming calls locally (without country code prefix), your phone should scan and find an exact match to your synchronized contacts with your Google account.

  • Helpful. Thanks.

  • …or you could just use our Prefixer app and make it append or remove a prefix on-the-fly for incoming calls to match contacts in your contact list. This way you don’t have to edit anything!
    Please visit our homepage: or search for Prefixer on Android market to download directly.

  • HasanDroid

    if I edit every contact number and add to every number a second number with country code wouldn’t that easier,
    And if it not working what should I do,
    Sorry but I didn’t completely understand ur way,
    Help plz.

    • Store 2 mobile number for each Contact Person. For example,

      Name: HasanDroid
      Mobile: xxx-xxxx
      Mobile: +960-xxx-xxxx

      I found it easier to do this on a .csv text file.

      There’s a link to an app on these comments too. I haven’t tried it.

  • Daði Snær Skúlason

    Anyone have a better workaround or fix in mind? Having a double address book is a rather dirty fix and the prefixer app does not work with the built in caller id. HTC Incredible with Android 2.3.

  • Hello all.

    I am using cyanogenmod, which is Android recompiled and packaged with improvements.

    Sometimes those improvements get back into the mainstream Android code.
    So I filed a request for this behaviour being fixed on the cyanogenmod issue tracking.
    The more it gets starred, the more likely the developers will take it into account, so I would please encourage you all to get there and star that.
    In the end, it could be fixed and entering the regular android baseline. It will take plenty of time even in the most optimistic circumstances, but it would still be awesome to have that fixed even if not in a short time.

    Here’s the link: