Examples of UriRecord


Examples of org.nfctools.ndef.wkt.records.UriRecord

  private Logger log = LoggerFactory.getLogger(getClass());
  private List<Record> records = new ArrayList<Record>();

  public SnepAgentListenterImpl(String url) {
    records.add(new UriRecord(url));
  }
View Full Code Here

Examples of org.nfctools.ndef.wkt.records.UriRecord

  public void run2() {
    ndefPushLlcpService = new NdefPushLlcpService(ndefListener);
    String content = "http://www.google.de";
    final Collection<Record> records = new ArrayList<Record>();
    records.add(new UriRecord(content));
    addMessages(records, new NdefPushFinishListener() {

      @Override
      public void onNdefPushFinish() {
        System.out.println("sent");
View Full Code Here

Examples of org.nfctools.ndef.wkt.records.UriRecord

        "26888282a6eff09dbc7e91e61dccf99bd660881ea69a6fad5941288f6cbc0f35")));
    return gcr;
  }

  public static UriRecord createUri() {
    UriRecord uriRecord = new UriRecord("http://www.google.com/");
    return uriRecord;
  }
View Full Code Here

Examples of org.nfctools.ndef.wkt.records.UriRecord

  public static SmartPosterRecord createSmartPoster() {
    SmartPosterRecord spr = new SmartPosterRecord();
    spr.setTitle(new TextRecord("Hello, this is a SmartPosterTag for NFC Tools", Charset.forName("UTF8"),
        Locale.ENGLISH));
    spr.setUri(new UriRecord("http://www.nfctools.org"));
    spr.setAction(new ActionRecord(Action.DEFAULT_ACTION));
    return spr;
  }
View Full Code Here

Examples of org.nfctools.ndef.wkt.records.UriRecord

  @Override
  public void onNdefOperations(NdefOperations ndefOperations) {
    System.out.println("Formated: " + ndefOperations.isFormatted() + " Writable: " + ndefOperations.isWritable());
    if (ndefOperations.isWritable()) {
      System.out.println("Writing NDEF data...");
      UriRecord record = new UriRecord("http://www.grundid.de");
      if (ndefOperations.isFormatted())
        ndefOperations.writeNdefMessage(record);
      else
        ndefOperations.format(record);
      System.out.println("Done");
View Full Code Here

Examples of org.nfctools.ndef.wkt.records.UriRecord

  @Test
  public void testWriteNdefMessages() throws Exception {
    for (Config config : WRITE_TEST) {
      init(config);
      ndefOperations.writeNdefMessage(new UriRecord("http://example.com/some/more/more/1234/data.html"));
      assertArrayEquals(expectedTag.getMemoryMap().getMemory(), tag.getMemoryMap().getMemory());
    }
  }
View Full Code Here

Examples of org.nfctools.ndef.wkt.records.UriRecord

  @Test
  public void testWriteNdefMessagesTooLong() throws Exception {
    for (Config config : WRITE_TEST) {
      try {
        init(config);
        ndefOperations.writeNdefMessage(new UriRecord("http://example.com/some/more/data.html?"
            + "someparameter=test&someparameter=test&someparameter=test&someparameter=test&"
            + "someparameter=test&someparameter=test&someparameter=test&someparameter=test&"
            + "someparameter=test&someparameter=test&someparameter=test&someparameter=test&"
            + "someparameter=test&someparameter=test&someparameter=test&someparameter=test&"
            + "someparameter=test&someparameter=test&someparameter=test&someparameter=test"));
View Full Code Here

Examples of org.nfctools.ndef.wkt.records.UriRecord

  public void testReadNdefMessages() throws Exception {
    for (Config config : READ_TEST) {
      init(config);
      List<Record> ndefMessage = ndefOperations.readNdefMessage();
      assertEquals(1, ndefMessage.size());
      UriRecord record = (UriRecord)ndefMessage.get(0);
      assertEquals("http://example.com/some/more/more/1234/data.html", record.getUri());
    }
  }
View Full Code Here

Examples of org.nfctools.ndef.wkt.records.UriRecord

  public static final byte[] dataBytes = { (byte)0xd1, 0x01, 0x09, 0x54, 0x05, 0x65, 0x6e, 0x2d, 0x55, 0x53, 0x35,
      0x30, 0x30 };

  @Test
  public void testEncode() throws Exception {
    GenericControlRecord gcr = new GenericControlRecord(new GcTargetRecord(new UriRecord(
        "file://localhost/Appli/CustomerBonus")));

    gcr.setAction(new GcActionRecord(new TextRecord("add", Charset.forName("utf8"), Locale.US)));
    gcr.setData(new GcDataRecord(new TextRecord("500", Locale.US)));
View Full Code Here

Examples of org.nfctools.ndef.wkt.records.UriRecord

    assertArrayEquals(GenericControlRecordDecoderTest.payload, encodedGcr);
  }

  @Test
  public void testEncodeSimple() throws Exception {
    GenericControlRecord gcr = new GenericControlRecord(new GcTargetRecord(new UriRecord("http://localhost/test")));
    byte[] encodedGcr = messageEncoder.encodeSingle(gcr);

    assertEquals(encodedNdefSimple, NfcUtils.convertBinToASCII(encodedGcr));
  }
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.