look at this:
https://www.b4x.com/android/forum/threads/how-to-open-contact-intent-to-add-new-from-vcard.145975/
somebody already went through this.
anyway, here's something you could build in b4a.
https://observablehq.com/@tophtucker/vcard-parser
looks like javascript, but you can use it as a base.
take your decoded vcard string and split it on the
eol character(s) to break it up into its components.
build a map of fields you can handle (refer to
@DonManfred's link above). step through each
line of split vcard text and, using the map to match
the fields. once you have the fields that make up
your new contact, run the intent with the fields as
extras. or figure out how to talk to the contacts
provider and have it create the contact, assuming
android still allows this.
regarding splitting the vcard, the eol character is
mostly chr(10), aka CRLF in b4a, but it could be
chr(13) + chr(10), so called "\r\n" sequence. (or it might
also simply be chr(13)). so, after splitting on CRLF, you
need to get rid of chr(13). just replace it with
an empty string "". if there is no chr(13), nothing happens.
no harm, no foul. don't test for it, just replace it:
thisline.replace(chr(13,""). defensive programming would
dictate that you might want to determine if chr(13) was
used in the first place.
if you examine the vcard format, you'll see that each
line may require some parsing before you extract
the actual value you need.
all very tedious, but good experience.
in addition to handling vcards, if your scanning app
came across a hyptertext link qr code, you would now
know that you had to code a little routine to send the
user to a web page. this too does not happen
automatically. you have to add it to your scanner.
qr codes have several such actionable links
beside vcards and https urls: tel, geo, etc, etc. these
all need to be coded by you. ditto for online payment
schemes triggered by qr codes or covid passes
(remember covid?) that used qr codes. all the
processing beyond decoding the qr code had to be
programmed. and in some cases, decoded qr codes
had to then be decrypted. this is what you are
effectively doing with a vcard: decode then "decrypt"
to add it to the contacts list.