开发者

QR Code import of vCard does not separate fields. Is it the format?

This text

BEGIN:VCARD
N:Haven;Richard;;;
ADR;DOM;PARCEL;HOME:;;9999 Mission Street ;Daly City;California;94014;U.S.A.
EMAIL;INTERNET:richard@domain.com
EMAIL;INTERNET:richard@domain.org
TEL;CELL:831-555-9315
TEL;CELL:831-555-0740
END:VCARD

converted into this QR Code and imported into my Motorola Droid does not separate the first and last name, and it does not separate the address.

Also, the phone and emails are assigned Home a开发者_高级运维nd Work and Home and Mobile; I expected at least the phones to go in as both Mobile.

Is it just the way Android parses vCards or can I change the encoding to allow separation and correctly specify the types of emails and phones?

Thanks


I think the question here concerns Barcode Scanner, rather than Android. Barcode Scanner (I'm a developer) parses all these fields. The issue is that the Android 1.x APIs do not let you specify all of the information you want to here as separate fields. Android 2.x does, to a much greater degree. Barcode Scanner must remain compatible with 1.5 for the moment since a small fraction of its users are still on 1.5 -- small fraction, but of 10 million people, so we can't just dump them.

It's conceivable, though quite painful, to write a version that uses one or the other API while still being 1.5-friendly.

Instead there is already a version that requires Android 2.2 and uses newer APIs. It's not going to be released for some time (see above) but you can give it a shot here: http://code.google.com/p/zxing/downloads/detail?name=BarcodeScanner-debug.apk


The most likely problem is that mandatory types are missing: "The vCard object MUST contain the FN, N and VERSION types."

You could also try a vCard validator to see if there are other problems. [Disclaimer: I wrote one]

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜