Custom VCard TEL and EMAIL types

I'm working on Android Contacts to/from VCard transform.

It must format Vcards from ContactsContract.Data table, and insert Vcards into ContactsContract.Data table.

Most of VCard properties can be transformed to appropriate ContactsContract.Data table rows.

But, VCard TEL and EMAIL properties has the different set of allowed type values than are defined in Android ContactsContract.

For example:

Allowed values for android phone type are: TYPE_CUSTOM, TYPE_HOME, TYPE_MOBILE, TYPE_WORK, TYPE_FAX_WORK, TYPE_FAX_HOME, TYPE_PAGER, TYPE_OTHER, TYPE_CALLBACK, TYPE_CAR, TYPE_COMPANY_MAIN, TYPE_ISDN, TYPE_MAIN, TYPE_OTHER_FAX, TYPE_RADIO, TYPE_TELEX, TYPE_TTY_TDD, TYPE_WORK_MOBILE, TYPE_WORK_PAGER, TYPE_ASSISTANT, TYPE_MMS

While VCard rfc 6350 define only the following type values: "text", "voice", "fax", "cell", "video", "pager", "textphone"

Some of them can be transformed, and some not.

Is it possible to set custom TEL and EMAIL types in VCard? If so, how to do it?

Upvotes: 1

Views: 2965

Answers (1)

Michael
Michael

Reputation: 35351

According to the vCard standard, it is possible to define custom types, as long as the type name begins with "X-".

6.10. Extended Properties and Parameters

The properties and parameters defined by this document can be
extended. Non-standard, private properties and parameters with a
name starting with "X-" may be defined bilaterally between two
cooperating agents without outside registration or standardization.

But remember that there's no guarantee that the application which consumes your vCard will understand those custom types.

Upvotes: 2

Related Questions