VCardParser parser;
if (format == BluetoothPbapClient.VCARD_TYPE_30) {
parser = new VCardParser_V30();
} else {
parser = new VCardParser_V21();
}
VCardEntryConstructor constructor = new VCardEntryConstructor();
VCardEntryCounter counter = new VCardEntryCounter();
CardEntryHandler handler = new CardEntryHandler();
constructor.addEntryHandler(handler);
parser.addInterpreter(constructor);
parser.addInterpreter(counter);
try {
parser.parse(in);
} catch (VCardException e) {
e.printStackTrace();
}