Code example for NfcF

Methods: closeconnecttransceive

1
    public byte[] executeRawCommand(byte[] rawCommand) throws TagLostException, IOException {
        if (rawCommand == null || rawCommand.length == 0)
            throw new IllegalArgumentException();
 
        try { 
            mNfcF.connect();
            byte[] response = mNfcF.transceive(rawCommand);
            return response;
        } finally { 
            try { 
                mNfcF.close();
            } catch (IOException e) {
                // ignore 
            } 
        } 
    } 
 
    /** 
     * 対応していないタグを渡された際に発生する例外です 
     *  
Contextual code suggestions in your IDE  Get Codota for Java