jjzjj

android - 如何从 Android 读取和写入 NfcA 卡

我已经制作了一个应用程序,当Intentandroid.nfc.action.TAG_DISCOVERED被发送时被调用,但是我想在onNewIntent方法中获取卡的信息,但我不知道如何处理这种nfc卡。我尝试使用以下代码:publicvoidonNewIntent(Intentintent){TagtagFromIntent=intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);//dosomethingwithtagFromIntentNfcAnfca=NfcA.get(tagFromIntent);try{nfca.connect();

Android nfcA.connect()、nfcA.transceive()、nfcA.setTimeout() 和 nfcA.getMaxTransceiveLength()

我有许多新手NfcA问题。在docs和网络上的其他地方似乎对此几乎没有指导,所以我希望没有人介意我在这里将一些基本问题串在一起......我正在使用nfcA.transceive()将数据写入我的NTAG213标签,如下所示:byte[]result=nfcA.transceive(newbyte[]{(byte)0xA2,//WRITE(byte)(pageNum&0x0ff),myData[0],myData[1],myData[2],myData[3]});1.result数组是值10的单个字节。这是什么意思,我应该注意哪些其他值?我也使用相同的方法从我的NTAG213标签中读取