Package org.nfctools

Examples of org.nfctools.NfcAdapter


  public void onTagHandingFailed(Throwable throwable) {
    throwable.printStackTrace();
  }

  protected void launchDemo(NfcTagListener... listeners) throws IOException {
    NfcAdapter nfcAdapter = new NfcAdapter(TerminalUtils.getAvailableTerminal(), TerminalMode.INITIATOR, this);
    for (NfcTagListener tagListener : listeners)
      nfcAdapter.registerTagListener(tagListener);
    nfcAdapter.registerUnknownTagListerner(new LoggingUnknownTagListener());
    nfcAdapter.startListening();
    System.out.println("Waiting for tags, press ENTER to exit");
    System.in.read();
  }
View Full Code Here


  public void runDemo(boolean initiatorMode, String preferredTerminalName) throws IOException {
    TerminalMode terminalMode = initiatorMode ? TerminalMode.INITIATOR : TerminalMode.TARGET;
    Terminal terminal = TerminalUtils.getAvailableTerminal(preferredTerminalName);
    System.out.println("Using: " + terminal.getTerminalName());
    NfcAdapter nfcAdapter = new NfcAdapter(terminal, terminalMode);
    nfcAdapter.setNfcipConnectionListener(llcpOverNfcip);
    nfcAdapter.startListening();
    System.out.println("Mode: " + terminalMode);
    System.out.println("Waiting for P2P, press ENTER to exit");
    System.in.read();
  }
View Full Code Here

    ndefPushLlcpService.addMessages(ndefRecords, finishListener);
  }

  public void runDemo() throws IOException {
    TerminalMode terminalMode = initiatorMode ? TerminalMode.INITIATOR : TerminalMode.TARGET;
    NfcAdapter nfcAdapter = new NfcAdapter(TerminalUtils.getAvailableTerminal(), terminalMode);
    nfcAdapter.setNfcipConnectionListener(llcpOverNfcip);
    nfcAdapter.startListening();
    System.out.println("Mode: " + terminalMode);
    System.out.println("Waiting for P2P, press ENTER to exit");
    System.in.read();
  }
View Full Code Here

TOP

Related Classes of org.nfctools.NfcAdapter

Copyright © 2018 www.massapicom. 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.