Maps the Android vCard API to the ez-vcard API.
Converts an ez-vcard VCard
object into the appropriate Android data fields, so it can be added to an Android user's contact list.
File vcardFile = ...
VCardReader reader = null;
try {
reader = new VCardReader(vcardFile);
reader.registerScribe(new AndroidCustomFieldScribe());
ContactOperations operations = new ContactOperations(getApplicationContext());
VCard vcard = null;
while ((vcard = reader.readNext()) != null) {
operations.insertContact(vcard);
}
} finally {
reader.close();
}
A downloadable JAR file does not exist yet. You can either build the project yourself, or copy and paste the code into your project (please leave the copyright notice in the source code if you choose the latter option).
If you are not using an Android-enabled IDE, follow these instructions so you can get the project to a point where you can build it.
./gradlew build
to build the application.