V
V
Vasiliy Shilov2013-02-26 19:38:56
HTC
Vasiliy Shilov, 2013-02-26 19:38:56

Transfer contacts from Philips Xenium X501 phone to HTC Desire SV?

I decided to write a question and immediately answer, because the solution already exists and may be useful to someone, someone will google it.
The beauty is that an attempt to transfer contacts from Philips via bluetooth was unsuccessful. There is no way to select all contacts and transfer them via bluetooth to another device. There is only an opportunity to throw one contact in vcard format (which is not very convenient and long). When I connected via bluetooth to Philips from HTC for import, the latter began to declare that it needed a WiFi connection with the first.
In the end, I found the option “Reserving contacts” under the “Organizer” menu item and got Contacts_backup.udx. I transferred it to HTC, tried to import it, but nothing happened. Then I opened Contacts_backup.udx and saw that this is a regular xml file

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE DataExchangeInfo SYSTEM "udx.dtd">
...
<vCard>
<vCardInfo>
<Sequence>тут какой-то порядковый номер видимо</Sequence>

<vCardField>
<vCardLocation>тут видимо где находился контакт - в телефоне или в сим</vCardLocation>

<N>тут имя в непонятном человеческому глазу виде</N>

<TEL>тут номер телефона</TEL>
</vCardField>
...

, and it came to mind just to take it, parse it and collect from it for each contact one file in vcard format, for which I wrote the following thing on what was at hand (PC):
<?php
$content = file_get_contents('./Contacts_backup.udx');
preg_match_all('/<vCardInfo>.*<\/vCardInfo>/imsU', $content, $items);
$pattern = 'BEGIN:VCARD
VERSION:2.1
N;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:{%NAME%}.
TEL;CELL:{%PHONE%}
END:VCARD
';
foreach($items[0] as $key => $item){
  preg_match('/<N>(.*)<\/N>/imsU', $item, $name);
  preg_match('/<TEL>(.*)<\/TEL>/imsU', $item, $phone);
  $output = $pattern;
  $output = str_replace('{%NAME%}', !empty($name[1]) ? $name[1] : '', $output);
  $output = str_replace('{%PHONE%}', !empty($phone[1]) ? $phone[1] : '', $output);
  $fd = fopen('./output/vcard'.$key.'.vcf','w+');
  fwrite($fd, $output);
  fclose($fd);
}

accordingly, I received a bunch of vcard<index>.vcf files in the output directory, uploaded them to HTC, installed the Import Contacts application, which allows you to take a directory with a bunch of vcard files and import them into contacts.
Regarding this method, do not find fault much. this is my first smartphone - before I somehow didn’t like them very much.
But it will be great if you write a simple way to transfer contacts from this type of phone to this type of smartphone, again it will be good if it turns out to be useful to people.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
subvillion, 2013-02-26
@subvillion

HTC Desire SV is android, parse your xml to csv and upload via google account d.pr/i/8EJz

V
vm916, 2013-02-26
@vm916

MTS has a "second memory" service! I think that other operators have something similar.

V
vovan888, 2014-05-19
@vovan888

There is a utility for android to import contacts in UDX format - goo.gl/nmZKKi

D
Dmitry Makarov, 2015-10-06
@MDiMaI666

program for windows https://drive.google.com/uc?export=download&confir...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question