Import Vcf Contacts

From Openmoko

Revision as of 11:06, 12 July 2008 by TimoJyrinki (Talk | contribs)

Jump to: navigation, search

If you want to import your old Contacts to your Neo you could use this simple script:

Simple vcf import script (could the script be licensed under BSD or GPL?)

Contents

Modification to the script

Al Johnson posted an extension to this script to handle vcf files wihl multiple contacts. It should work as before if there's just one contact per file. Here's the modified bit:

for name in names:
  print name
  vcard = ""
  f=open(name,'r')
  for line in f:
   vcard = vcard + line
   if line[:9] == "END:VCARD":
     getAddressBook().addContact(vcard)
     vcard = ""

Exporting old contacts to VCard format

Next step is to export your old contacts as vcf. I know its possible with Nokia phones and i used a Winmobile->activesync->Outlook export plugin to get my Contacts from my old Cell. In LG phones the backup function to memory card creates one file with multiple VCards. Etc.

Usage

The script is for the 2007.2 Version (default install on Neo FreeRunner), not for Qtopia

You need Python to use this script so do a

opkg install python-dbus

to install python and the python dbus module

The script does a listdir and imports ALL files it found in that dir. (i'm a bad python programmer)

  1. Copy all vcf files to a separate directory on my freerunner
  2. Copy the ac script to the parent directory also on my freerunner
  3. Have the contacts program running (so you have eds running too)
  4. Go to the terminal on the freerunner and type in the vcf directory: "python ../ac" (root@om-gta02:~/vcf# python ../ac)
    1. Note: You must call the script in the OM terminal not via Bluetooth or USB or you get a dbus error.
  5. Done :D

Troubleshooting

  • Make sure you have python and python-dbus installed
  • Make sure you have no illegal chars (utf) in the filename and inside the vcf files. (I had problems with Ü,Ä etc)
    • The characters seem to work if you convert them from =C3=A4 type of format to proper UTF-8, and the vcards also specify UTF-8 charset. you cannot use other charsets besides UTF-8 since they are delivered via DBus which does not allow others.
  • Only vcf files should be in your current directory so do a ../ac.
  • You must call the script in the OM terminal not via Bluetooth or USB. If you do so a dbus error occur


Thanks to Import_Sim_Contacts for the original Python Script.

Personal tools

If you want to import your old Contacts to your Neo you could use this simple script:

Simple vcf import script (could the script be licensed under BSD or GPL?)

Modification to the script

Al Johnson posted an extension to this script to handle vcf files wihl multiple contacts. It should work as before if there's just one contact per file. Here's the modified bit:

for name in names:
  print name
  vcard = ""
  f=open(name,'r')
  for line in f:
   vcard = vcard + line
   if line[:9] == "END:VCARD":
     getAddressBook().addContact(vcard)
     vcard = ""

Exporting old contacts to VCard format

Next step is to export your old contacts as vcf. I know its possible with Nokia phones and i used a Winmobile->activesync->Outlook export plugin to get my Contacts from my old Cell. In LG phones the backup function to memory card creates one file with multiple VCards. Etc.

Usage

The script is for the 2007.2 Version (default install on Neo FreeRunner), not for Qtopia

You need Python to use this script so do a

opkg install python-dbus

to install python and the python dbus module

The script does a listdir and imports ALL files it found in that dir. (i'm a bad python programmer)

  1. Copy all vcf files to a separate directory on my freerunner
  2. Copy the ac script to the parent directory also on my freerunner
  3. Have the contacts program running (so you have eds running too)
  4. Go to the terminal on the freerunner and type in the vcf directory: "python ../ac" (root@om-gta02:~/vcf# python ../ac)
    1. Note: You must call the script in the OM terminal not via Bluetooth or USB or you get a dbus error.
  5. Done :D

Troubleshooting

  • Make sure you have python and python-dbus installed
  • Make sure you have no illegal chars (utf) in the filename and inside the vcf files. (I had problems with Ü,Ä etc)
    • The characters seem to work if you convert them from =C3=A4 type of format to proper UTF-8, and the vcards also specify UTF-8 charset. you cannot use other charsets besides UTF-8 since they are delivered via DBus which does not allow others.
  • Only vcf files should be in your current directory so do a ../ac.
  • You must call the script in the OM terminal not via Bluetooth or USB. If you do so a dbus error occur


Thanks to Import_Sim_Contacts for the original Python Script.