I have a list of contacts (name, phone, ..) displayed on B4Xtable and I want to export selected item to VCF file and then use FileProvider to send it by email or whatsapp. how to create VCF file? and what is the mime type to use in this case?
Hi, has anyone got any insight in how to make a Vcard QR Code; i.e. so someone can scan the QR Code and it inserts your details into their contacts list? Plenty of websites offer such a function, but I`d like to make a small app for creating it on the phone? James
thanks so much, it helped to understand how things go, never knew that it's just a type of text file, i opened presaved VCF with binary editor, it is easy to create, but still have one more problem with base64 picture encoding
Edit: i found it here
Updated Library https://www.b4x.com/android/forum/threads/b4x-library-base64-encode-decode-image-and-file-library.115033/page-2#post-998317 From an idea of the Great Peter ( https://www.b4x.com/android/forum/threads/base64-encode-decode-image-library.31031/ ) "...in attached the library for...
Public Sub GenerateVCF() As String
Dim SB As StringBuilder
SB.Initialize
SB.Append("BEGIN:VCARD").Append(Chr(0x0D)).Append(Chr(0x0A))
SB.Append("VERSION:2.1").Append(Chr(0x0D)).Append(Chr(0x0A))
SB.Append("N;LANGUAGE=en-us:;").Append(Chr(0x0D)).Append(Chr(0x0A))
SB.Append("FN:").Append(ContactName).Append(Chr(0x0D)).Append(Chr(0x0A))
SB.Append("ORG:").Append(CompanyName).Append(Chr(0x0D)).Append(Chr(0x0A))
SB.Append("TITLE:").Append(JobTitle).Append(Chr(0x0D)).Append(Chr(0x0A))
SB.Append("TEL;WORK;VOICE:").Append(WorkPhone).Append(Chr(0x0D)).Append(Chr(0x0A))
SB.Append("TEL;HOME;VOICE:").Append(HomePhone).Append(Chr(0x0D)).Append(Chr(0x0A))
SB.Append("TEL;CELL;VOICE:").Append(MobilePhone).Append(Chr(0x0D)).Append(Chr(0x0A))
SB.Append("EMAIL;PREF;INTERNET:").Append(WorkEmail).Append(Chr(0x0D)).Append(Chr(0x0A))
SB.Append("EMAIL;INTERNET:").Append(HomeEmail).Append(Chr(0x0D)).Append(Chr(0x0A))
SB.Append("End:VCARD").Append(Chr(0x0D)).Append(Chr(0x0A))
Return SB.ToString
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.