android vcard string to contact

前端 未结 2 1865
难免孤独
难免孤独 2020-12-05 16:28

i\'m wondering if there\'s a clean way to import a vcard as an android contact. i have a vcard parser, but mapping each possible vcard field and field type is going to be a

2条回答
  •  执念已碎
    2020-12-05 16:43

    I struggled a lot for importing contacts as a vCard in Android and after spending a lot of time I came to there are no public API's for importing contacts.

    Only way in my knowledge is to reuse the source code of the Android. I achieved the same by reusing the Android 2.1 source code.

    The files can be referred from

    http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.1_r2/android/pim/vcard/exception/VCardException.java/

    At right hand side explorer you will find all the files needed under the pim folder. The file which will be responsible to start the procedure is ImportVCardActivity.java

    I hope it helps!!

提交回复
热议问题