1

I am struggling with getting contacts info from Lumia 800 (WP7). I need to import them into Samsung Galxy S6 (Android 5). I have tried following:

  • Standard WP7 contact transfer app using bluetooth (it is capable only to import contacts but not to export them)
  • Sync with Exchange and Hotmail account
    (does not work at all - restarted phone and tried various accounts with contacts sync on but no contacts were synced)
  • Free apps in Windows store - none produced importable VCards or CSV

Is there some hidden settings that prevents me to sync contacts or some free app that produces importable and properly formatted CSV? Or should I do system update to make contact transfer app working in both directions?

  • If you go to edit a contact, what options does it give? – Rowland Shaw Apr 27 '15 at 9:17
  • Just three icons - pin, link, edit - and delete. Not share - it works on WP8. – Vojtěch Dohnal Apr 27 '15 at 9:56
1

All the contacts on Windows Phones are synchronised with online services, or stored on the SIM card, so all you should need to do is to set your new phone to synchronise with the same online services, and transfer the SIM across (if you use contacts stored on the SIM).

If you really did want to export as VCard or CSV, your options are limited as on Windows Phone 7.x (which the Lumia 800 runs), third party apps have no method of enumerating all the contacts in your addressbook, and any third party option would mean that you'd have to export each contact in turn. You would have to check the process for each online service that you're conencted to for instructions, to perform the action via their website, or otherwise.

  • Thanks, it is quite hopeless, when cloud sync is not working then... I will add solution that worked for me as well, but it is quite complicated. – Vojtěch Dohnal Apr 27 '15 at 12:58
0

Ok, what I did - (though it was not much faster than rewriting 360 contacts).

I have used freeware Qontact which allows export to a text file. Export to VCards is disabled in free edition so it was not an option for me at the moment.

Then I have created in Visual Studio a C# console application to convert the text file to VCard.

Here it is:

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using Thought.vCards; //https://www.nuget.org/packages/Thought.vCards/

namespace VCardGen
{
    class Program
    {
        const string INPUT_FILE = @"C:\VSProjects\VCardGen\in.txt";
        const string OUTPUT_FILE = @"C:\\VSProjects\\VCardGen\\Files5\\{0}.vcf";
        //What encoding comes here? This worked but national characters displayed as ?
        static Encoding ENCODING = Encoding.GetEncoding("Windows-1250");

        /// <summary>
        /// Removes special characters
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        static String RemoveDiacritics(String s)
        {
            String normalizedString = s.Normalize(NormalizationForm.FormD);
            StringBuilder stringBuilder = new StringBuilder();
            for (int i = 0; i < normalizedString.Length; i++)
            {
                Char c = normalizedString[i];
                if (CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark && CharUnicodeInfo.GetUnicodeCategory(c)!=UnicodeCategory.OtherSymbol)
                    stringBuilder.Append(c);
            }
            return stringBuilder.ToString();
        }

        /// <summary>
        /// Saves one vCard
        /// </summary>
        /// <param name="c"></param>
        static void SaveVCard(vCard c, Encoding e)
        {
            if (c == null) return;
            string fn = RemoveDiacritics(c.FamilyName + c.GivenName).Trim().Replace(" ", ""); ;
            vCardStandardWriter writer = new vCardStandardWriter();
            {
                writer.EmbedInternetImages = false;
                writer.EmbedLocalImages = false;
                writer.Options = vCardStandardWriterOptions.IgnoreCommas;
                using (var file = File.OpenWrite(String.Format(OUTPUT_FILE, fn)))
                using (var fwriter = new StreamWriter(file, e))
                {
                    writer.Write(c, fwriter);
                }
                writer = null;
            }
        }

        static void Main(string[] args)
        {
            //Load file outputed by Qontact
            string text = System.IO.File.ReadAllText(INPUT_FILE, ENCODING);
            List<string> l = text.Split('\n').ToList();
            vCard c= null;

            //Process Qontact file line by line
            foreach (string s in l)
            {
                string x = s.Trim();
                if (x.Length == 0) continue;
                if (x.StartsWith("-"))
                {
                    SaveVCard(c,ENCODING);
                    string[] np = x.Substring(1).Split(',');
                    c = new vCard();
                    c.FamilyName = np[0].Trim();
                    if (np.Length>1) c.GivenName = np[1].Trim();
                }
                else if (x.StartsWith("NAME: "))
                    c.DisplayName = x.Replace("NAME: ", "").Trim() ;                    
                else if (x.StartsWith("MOB: "))
                    c.Phones.Add(new vCardPhone(x.Replace("MOB: ", "").Trim(), vCardPhoneTypes.Cellular));
                else if (x.StartsWith("ORG:"))
                    c.Organization = x.Replace("ORG:", "").Trim();
                else if (x.StartsWith("ADDR:"))
                {
                    string n = x.Replace("ADDR:", "");
                    vCardDeliveryAddress a = new vCardDeliveryAddress();
                    a.Street = n.Trim();
                    c.DeliveryAddresses.Add(a);
                }
                else if (x.StartsWith("EMAIL:"))
                    c.EmailAddresses.Add(new vCardEmailAddress(x.Replace("EMAIL:", "").Trim()));
                else if (x.StartsWith("HOME :"))
                    c.Phones.Add(new vCardPhone(x.Replace("HOME :", "").Trim(), vCardPhoneTypes.Home));
                else if (x.StartsWith("TEL:"))
                    c.Phones.Add(new vCardPhone(x.Replace("TEL:", "").Trim(), vCardPhoneTypes.Work));                
            }
            SaveVCard(c, ENCODING);
        }
    }
}

using http://www.thoughtproject.com/Libraries/vCard/ - did not find anything better. https://www.nuget.org/packages/Thought.vCards/

It was quite annoying because Samsung Galaxy S6 did not accept vCards that were correctly opened in Outlook, so it was not very straightforward, especially text Encoding used I did not quite unerstood. I had to restart Samsung Galaxy A6 after import - it got stuck showing many paralel vCard imports. But contacts were imported succesfully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.