Examples of UnsupportedExternalTypeRecord


Examples of org.nfctools.ndef.ext.UnsupportedExternalTypeRecord

  }

  @Test
  public void testEncodeExternalType() throws Exception {
    byte[] single = encoder.encodeSingle(new UnsupportedExternalTypeRecord("android.com:pkg", "de.grundid.test1234"));
    assertEquals("D40F13616E64726F69642E636F6D3A706B6764652E6772756E6469642E7465737431323334",
        NfcUtils.convertBinToASCII(single));
  }
View Full Code Here

Examples of org.nfctools.ndef.ext.UnsupportedExternalTypeRecord

  private ExternalTypeEncoder encoder = new ExternalTypeEncoder();
  private ExternalTypeDecoder decoder = new ExternalTypeDecoder();

  @Test
  public void testExternalTypeEncoder() throws Exception {
    UnsupportedExternalTypeRecord record = new UnsupportedExternalTypeRecord("android.com:pkg", "demo.package");
    NdefRecord ndefRecord = encoder.encodeRecord(record, null);

    assertEquals(NdefConstants.TNF_EXTERNAL_TYPE, ndefRecord.getTnf());

    assertEquals("android.com:pkg", new String(ndefRecord.getType()));
View Full Code Here

Examples of org.nfctools.ndef.ext.UnsupportedExternalTypeRecord

    NdefRecord record = new NdefRecord(NdefConstants.TNF_EXTERNAL_TYPE, namespace.getBytes(), new byte[0],
        "content".getBytes());

    assertTrue(decoder.canDecode(record));

    UnsupportedExternalTypeRecord externalType = (UnsupportedExternalTypeRecord) decoder.decodeRecord(record, null);

    assertEquals(namespace, externalType.getNamespace());
    assertEquals("content", externalType.getContent());

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.