当前位置: 首页>>代码示例>>Java>>正文


Java AddressBookParsedResult类代码示例

本文整理汇总了Java中com.google.zxing.client.result.AddressBookParsedResult的典型用法代码示例。如果您正苦于以下问题:Java AddressBookParsedResult类的具体用法?Java AddressBookParsedResult怎么用?Java AddressBookParsedResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AddressBookParsedResult类属于com.google.zxing.client.result包,在下文中一共展示了AddressBookParsedResult类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: encodeQRCodeContents

import com.google.zxing.client.result.AddressBookParsedResult; //导入依赖的package包/类
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toIterable(contact.getNames()),
                                    contact.getOrg(),
                                    toIterable(contact.getAddresses()),
                                    toIterable(contact.getPhoneNumbers()),
                                    toIterable(contact.getEmails()),
                                    toIterable(contact.getURLs()),
                                    null);
  // Make sure we've encoded at least one field.
  if (!encoded[1].isEmpty()) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(R.string.contents_contact);
  }
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:17,代码来源:QRCodeEncoder.java

示例2: AddressBookResultHandler

import com.google.zxing.client.result.AddressBookParsedResult; //导入依赖的package包/类
public AddressBookResultHandler(Activity activity, ParsedResult result) {
  super(activity, result);
  AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
  String[] addresses = addressResult.getAddresses();
  boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null && !addresses[0].isEmpty();
  String[] phoneNumbers = addressResult.getPhoneNumbers();
  boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
  String[] emails = addressResult.getEmails();
  boolean hasEmailAddress = emails != null && emails.length > 0;

  fields = new boolean[MAX_BUTTON_COUNT];
  fields[0] = true; // Add contact is always available
  fields[1] = hasAddress;
  fields[2] = hasPhoneNumber;
  fields[3] = hasEmailAddress;

  buttonCount = 0;
  for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
    if (fields[x]) {
      buttonCount++;
    }
  }
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:24,代码来源:AddressBookResultHandler.java

示例3: encodeQRCodeContents

import com.google.zxing.client.result.AddressBookParsedResult; //导入依赖的package包/类
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toList(contact.getNames()),
                                    contact.getOrg(),
                                    toList(contact.getAddresses()),
                                    toList(contact.getPhoneNumbers()),
                                    null,
                                    toList(contact.getEmails()),
                                    toList(contact.getURLs()),
                                    null);
  // Make sure we've encoded at least one field.
  if (!encoded[1].isEmpty()) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(R.string.contents_contact);
  }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:18,代码来源:QRCodeEncoder.java

示例4: encodeQRCodeContents

import com.google.zxing.client.result.AddressBookParsedResult; //导入依赖的package包/类
private void encodeQRCodeContents(AddressBookParsedResult contact) {
    ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
    String[] encoded = encoder.encode(toList(contact.getNames()),
            contact.getOrg(),
            toList(contact.getAddresses()),
            toList(contact.getPhoneNumbers()),
            null,
            toList(contact.getEmails()),
            toList(contact.getURLs()),
            null);
    // Make sure we've encoded at least one field.
    if (!encoded[1].isEmpty()) {
        contents = encoded[0];
        displayContents = encoded[1];
        title = activity.getString(R.string.contents_contact);
    }
}
 
开发者ID:xiong-it,项目名称:ZXingAndroidExt,代码行数:18,代码来源:QRCodeEncoder.java

示例5: AddressBookResultHandler

import com.google.zxing.client.result.AddressBookParsedResult; //导入依赖的package包/类
public AddressBookResultHandler(Activity activity, ParsedResult result) {
    super(activity, result);
    AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
    String[] addresses = addressResult.getAddresses();
    String[] phoneNumbers = addressResult.getPhoneNumbers();
    String[] emails = addressResult.getEmails();

    fields = new boolean[MAX_BUTTON_COUNT];
    fields[0] = true; // Add contact is always available
    fields[1] = addresses != null && addresses.length > 0 && addresses[0] != null && !addresses[0].isEmpty();
    fields[2] = phoneNumbers != null && phoneNumbers.length > 0;
    fields[3] = emails != null && emails.length > 0;

    buttonCount = 0;
    for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
        if (fields[x]) {
            buttonCount++;
        }
    }
}
 
开发者ID:xiong-it,项目名称:ZXingAndroidExt,代码行数:21,代码来源:AddressBookResultHandler.java

示例6: AddressBookResultHandler

import com.google.zxing.client.result.AddressBookParsedResult; //导入依赖的package包/类
public AddressBookResultHandler(Activity activity, ParsedResult result) {
	super(activity, result);
	AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
	String[] addresses = addressResult.getAddresses();
	boolean hasAddress = addresses != null && addresses.length > 0
			&& addresses[0] != null && !addresses[0].isEmpty();
	String[] phoneNumbers = addressResult.getPhoneNumbers();
	boolean hasPhoneNumber = phoneNumbers != null
			&& phoneNumbers.length > 0;
	String[] emails = addressResult.getEmails();
	boolean hasEmailAddress = emails != null && emails.length > 0;

	fields = new boolean[MAX_BUTTON_COUNT];
	fields[0] = true; // Add contact is always available
	fields[1] = hasAddress;
	fields[2] = hasPhoneNumber;
	fields[3] = hasEmailAddress;

	buttonCount = 0;
	for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
		if (fields[x]) {
			buttonCount++;
		}
	}
}
 
开发者ID:yun2win,项目名称:tvConnect_android,代码行数:26,代码来源:AddressBookResultHandler.java

示例7: AddressBookResultHandler

import com.google.zxing.client.result.AddressBookParsedResult; //导入依赖的package包/类
public AddressBookResultHandler(Activity activity, ParsedResult result) {
	super(activity, result);
	AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
	String[] addresses = addressResult.getAddresses();
	boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null
			&& !addresses[0].isEmpty();
	String[] phoneNumbers = addressResult.getPhoneNumbers();
	boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
	String[] emails = addressResult.getEmails();
	boolean hasEmailAddress = emails != null && emails.length > 0;

	fields = new boolean[MAX_BUTTON_COUNT];
	fields[0] = true; // Add contact is always available
	fields[1] = hasAddress;
	fields[2] = hasPhoneNumber;
	fields[3] = hasEmailAddress;

	buttonCount = 0;
	for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
		if (fields[x]) {
			buttonCount++;
		}
	}
}
 
开发者ID:xiong-it,项目名称:PortraitZXing,代码行数:25,代码来源:AddressBookResultHandler.java

示例8: encodeQRCodeContents

import com.google.zxing.client.result.AddressBookParsedResult; //导入依赖的package包/类
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toIterable(contact.getNames()),
                                    contact.getOrg(),
                                    toIterable(contact.getAddresses()),
                                    toIterable(contact.getPhoneNumbers()),
                                    toIterable(contact.getEmails()),
                                    contact.getURL(),
                                    null);
  // Make sure we've encoded at least one field.
  if (encoded[1].length() > 0) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(fakeR.getId("string", "contents_contact"));
  }
}
 
开发者ID:atomsheep,项目名称:sres-app,代码行数:17,代码来源:QRCodeEncoder.java

示例9: encodeQRCodeContents

import com.google.zxing.client.result.AddressBookParsedResult; //导入依赖的package包/类
private void encodeQRCodeContents(AddressBookParsedResult contact) {
    ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
    String[] encoded = encoder.encode(toIterable(contact.getNames()),
            contact.getOrg(),
            toIterable(contact.getAddresses()),
            toIterable(contact.getPhoneNumbers()),
            toIterable(contact.getEmails()),
            toIterable(contact.getURLs()),
            null);
    // Make sure we've encoded at least one field.
    if (encoded[1].length() > 0) {
        contents = encoded[0];
        displayContents = encoded[1];
        title = activity.getString(R.string.contents_contact);
    }
}
 
开发者ID:yakovenkodenis,项目名称:Discounty,代码行数:17,代码来源:QRCodeEncoder.java

示例10: AddressBookResultHandler

import com.google.zxing.client.result.AddressBookParsedResult; //导入依赖的package包/类
public AddressBookResultHandler(Activity activity, ParsedResult result) {
    super(activity, result);
    AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
    String[] addresses = addressResult.getAddresses();
    boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null && addresses[0].length() > 0;
    String[] phoneNumbers = addressResult.getPhoneNumbers();
    boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
    String[] emails = addressResult.getEmails();
    boolean hasEmailAddress = emails != null && emails.length > 0;

    fields = new boolean[MAX_BUTTON_COUNT];
    fields[0] = true; // Add contact is always available
    fields[1] = hasAddress;
    fields[2] = hasPhoneNumber;
    fields[3] = hasEmailAddress;

    buttonCount = 0;
    for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
        if (fields[x]) {
            buttonCount++;
        }
    }
}
 
开发者ID:yakovenkodenis,项目名称:Discounty,代码行数:24,代码来源:AddressBookResultHandler.java

示例11: encodeQRCodeContents

import com.google.zxing.client.result.AddressBookParsedResult; //导入依赖的package包/类
private void encodeQRCodeContents(AddressBookParsedResult contact) {
    ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
    String[] encoded = encoder.encode(toIterable(contact.getNames()),
            contact.getOrg(),
            toIterable(contact.getAddresses()),
            toIterable(contact.getPhoneNumbers()),
            toIterable(contact.getEmails()),
            toIterable(contact.getURLs()),
            null);
    // Make sure we've encoded at least one field.
    if (!encoded[1].isEmpty()) {
        contents = encoded[0];
        displayContents = encoded[1];
        title = activity.getString(R.string.contents_contact);
    }
}
 
开发者ID:guiguito,项目名称:AIRShare,代码行数:17,代码来源:QRCodeEncoder.java

示例12: getContactDetailsFromUri

import com.google.zxing.client.result.AddressBookParsedResult; //导入依赖的package包/类
public static AddressBookParsedResult getContactDetailsFromUri(
		Context context, Uri contactUri) {
	try {
		byte[] vcard;
		String vcardString;
		InputStream stream;
		stream = context.getContentResolver().openInputStream(contactUri);
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		byte[] buffer = new byte[2048];
		int bytesRead;
		while ((bytesRead = stream.read(buffer)) > 0) {
			baos.write(buffer, 0, bytesRead);
		}
		vcard = baos.toByteArray();
		vcardString = new String(vcard, 0, vcard.length, "UTF-8");
		Result result = new Result(vcardString, vcard, null,
				BarcodeFormat.QR_CODE);
		ParsedResult parsedResult = ResultParser.parseResult(result);
		return (AddressBookParsedResult) parsedResult;
	} catch (Exception e) {
		return null;
	}
}
 
开发者ID:guiguito,项目名称:AIRShare,代码行数:24,代码来源:ContactsUtils.java

示例13: AddressBookResultHandler

import com.google.zxing.client.result.AddressBookParsedResult; //导入依赖的package包/类
public AddressBookResultHandler(Activity activity, ParsedResult result) {
  super(activity, result);
  AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
  String[] addresses = addressResult.getAddresses();
  String[] phoneNumbers = addressResult.getPhoneNumbers();
  String[] emails = addressResult.getEmails();

  buttonIDsToShow = new HashSet<>();
  buttonIDsToShow.add(R.id.button_add_contact);
  if (addresses != null && addresses.length > 0 && addresses[0] != null && !addresses[0].isEmpty()) {
    buttonIDsToShow.add(R.id.button_show_map);
  }
  if (phoneNumbers != null && phoneNumbers.length > 0) {
    buttonIDsToShow.add(R.id.button_dial);
  }
  if (emails != null && emails.length > 0) {
    buttonIDsToShow.add(R.id.button_email);
  }
}
 
开发者ID:srowen,项目名称:zxing-bsplus,代码行数:20,代码来源:AddressBookResultHandler.java


注:本文中的com.google.zxing.client.result.AddressBookParsedResult类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。