Organizational Research By

Surprising Reserch Topic

Question:NFC with NFC-Tools, Creating NDEF Application

I am attempting to do what I would have guessed would be pretty simple, but as it turns out is not. I have an ACR122 NFC reader and a bunch of Mifare Classic and Mifare Ultralight tags, and all I want to do is read and write a mime-type and a short text string to each card from a Java application. Here's what I've got working so far:

    I can connect to my reader and listen for tags
    I can detect which type of tag is on the reader
    On the Mifare Classic tags I can loop through all of the data on the tag (after programming the tag from my phone) and build an ascii string, but most of the data is "junk" data
    I can determine whether or not there is an Application directory on the tag.

Here's my code for doing that:


public static void main(String[] args){
        TerminalFactory factory = TerminalFactory.getDefault();
        List terminals;
            TerminalHandler handler = new TerminalHandler();
            terminals = factory.terminals().list();
            CardTerminal cardTerminal = terminals.get(0);
            AcsTerminal terminal = new AcsTerminal();
            NfcAdapter adapter = new NfcAdapter(handler.getAvailableTerminal(), TerminalMode.INITIATOR);
            adapter.registerTagListener(new CustomNDEFListener());
        catch(IOException e){
        catch(CardException e){
            System.out.println("CardException: " + e.getMessage());


asked Sep 13, 2013 in Core java by rajesh
edited Sep 12, 2013
0 votes

Related Hot Questions

2 Answers

0 votes
answered Sep 13, 2013 by rajesh
edited Sep 12, 2013
0 votes
answered Sep 13, 2013 by rajesh
edited Sep 12, 2013