Code example for NdefRecord

0
	 *            本文 
	 * @return 作成した NdefRecord 
	 */ 
	public static NdefRecord newMimeRecord(String mimeType, byte[] payload) {
		byte[] mimeBytes = mimeType.getBytes(Charset.forName("UTF-8"));
		NdefRecord mimeRecord = new NdefRecord(NdefRecord.TNF_MIME_MEDIA,
				mimeBytes, new byte[0], payload);
		return mimeRecord;
	} 
 
	public static NdefRecord newAndroidApplicationRecord(String packageName) {
		return NdefRecord.createApplicationRecord(packageName);
	} 
 
	public static NdefRecord newAndroidApplicationRecord(Context context) {
		return newAndroidApplicationRecord(context.getPackageName());
	} 
 
	public static NdefRecord newImageRecord(Bitmap bitmap) {
		ByteArrayOutputStream out = new ByteArrayOutputStream();
Experience pair programming with AI  Get Codota for Java