Comments (4)
Hi Giovanni,
You can call the addParameter()
method on the Telephone
object. But you shouldn't put spaces in parameter names. The consuming application may not be able to read it.
Telephone tel = new Telephone("+1123123123");
tel.addParameter("X-Customer Service", "");
from ez-vcard.
Hi Mike,
Thank you for the reply, I did exactly like that but it returns:
TEL;X-Customer Service= :+1123123123
And that is not working on android, namely the number will be imported but the custom label not.
Is there a way to have it without '='?
from ez-vcard.
Well, all parameters are "supposed" to have a name and a value. But you can get around this by assigning a "TYPE" parameter to the property, as demonstrated below. The vCard must be written under version 2.1 for this to work.
VCard vcard = new VCard();
vcard.setVersion(VCardVersion.V2_1);
Telephone tel = new Telephone("+1123123123");
tel.getParameters().addType("X-Customer Service");
vcard.addTelephoneNumber(tel);
vcard.write(System.out);
Outputs:
BEGIN:VCARD
VERSION:2.1
TEL;X-CUSTOMER SERVICE:+1123123123
X-PRODID:ez-vcard 0.9.8
END:VCARD
from ez-vcard.
Lovely it is working, thanks!
from ez-vcard.
Related Issues (20)
- IMPP: case-insensitive comparison of schemes HOT 1
- VCardWriter - Writes data without proper formatting for Google Contacts - Expected : YYYY-MM-DD ; current : YYYYMMDD HOT 2
- [Q] How do I get the `RawProperty`s? HOT 1
- Version 0.11.3 vulnerabilities HOT 3
- Migration to 0.12.0 while still supporting Android API 21..25 HOT 6
- Add support for Jigsaw modules HOT 1
- Parsing from chunk of text HOT 2
- Custom getter in VCardProperty HOT 9
- Invalid value for "MonthOfYear" caused by wrong BDAY date HOT 1
- Raw property values HOT 4
- Relations and Anniversaries are lost in serialization HOT 2
- what is the way to add social media contact? HOT 1
- Default line folding line length is not null HOT 1
- [Compatibility] Treat KIND values case-insensitive HOT 2
- whole vCard being drop instead of the specific corrupted fields HOT 3
- WhatsApp format of vcard is not supported?
- No Class found in DavX5 HOT 1
- hCard GEO HOT 1
- CRLF is handled incorrectly in vcard 2.1 properties HOT 8
- Wrong value for vCard property VERSION returned HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ez-vcard.