<td id="n3ws3"></td>
          <th id="n3ws3"></th>
            <b id="n3ws3"><menuitem id="n3ws3"></menuitem></b>
            <del id="n3ws3"><form id="n3ws3"></form></del>
            <b id="n3ws3"><menuitem id="n3ws3"></menuitem></b>
          1. <dd id="n3ws3"><dl id="n3ws3"></dl></dd>

            智能卡讀寫器,IC卡讀卡器

            RFID讀卡器包含低頻ID卡讀卡器,高頻IC卡讀卡器,NFC讀寫器,超高頻UHF讀卡器以及相應(yīng)的模組,智能卡包含印刷彩卡,CPU卡,電子標(biāo)簽

            安卓(Android)下如何開發(fā)USB NFC讀寫器app

            對(duì)安卓工程師來(lái)說(shuō),在安卓下使用USB設(shè)備需要了解很多硬件的內(nèi)容,這可能會(huì)導(dǎo)致工程周期的延長(zhǎng)或者app的不穩(wěn)定。為了將這種風(fēng)險(xiǎn)降到最低,友我科技發(fā)布了NFC讀寫器在安卓下的sdk,使用NFC讀寫器的類接口,安卓工程師就可以直接調(diào)用NFC讀寫器了,簡(jiǎn)單可靠。

            NFC讀寫器的安卓庫(kù)文件為:yoworfidreader.jar

            在ADT工程中導(dǎo)入yoworfidreader.jar庫(kù)文件,即可在工程中引用NFC讀寫器的類文件

            ?

            在代碼中調(diào)用:


            public usbreader rfidreader;

            rfidreader = new usbreader();

            這樣就創(chuàng)建了NFC讀寫器的類的實(shí)體,下面只要使用rfidreader的各種方法就可以了,以下為讀寫M1卡的例子代碼:


            protected void onCreate(Bundle savedInstanceState) {

            super.onCreate(savedInstanceState);

            setContentView(R.layout.activity_m1);

            rbKeyA=(RadioButton) findViewById(R.id.rbkeya);

            txtCardNo = (TextView) findViewById(R.id.txtcardno);

            edtKey = (EditText) findViewById(R.id.edtkey);

            edtKey.setText(""FFFFFFFFFFFF"");

            edtBlockID = (EditText) findViewById(R.id.edtblock);

            edtBlockID.setText(""1"");

            edtData = (EditText) findViewById(R.id.edtdata);

            edtData.setText(""11111111111111112222222222222222"");

            Button button = (Button) findViewById(R.id.btnreadCard);

            button.setOnClickListener(new View.OnClickListener() {

            ? ? ? ? ? ? public void onClick(View v) {

            ? ? ? ? ? ? txtCardNo.setText("""");

            ? ? ? ? ? ? edtData.setText("""");

            ? ? ? ? ? ? ?

            ? ? ? ? ? ? int BlockID = MainActivity.ValidInt( edtBlockID.getText().toString() , 63);

            ? ? ? ? ? ? if(BlockID<0)

            ? ? ? ? ? ? {

            ? ? ? ? ? ? MainActivity.dialog(""塊號(hào)必須是0-63"",M1.this);

            ? ? ? ? ? ? return;

            ? ? ? ? ? ? }

            ? ? ? ? ? ? ?

            ? ? ? ? ? ? if(!MainActivity.ValidHexString(edtKey.getText().toString(), 6))

            ? ? ? ? ? ? {

            ? ? ? ? ? ? MainActivity.dialog(""密鑰必須是6字節(jié)16進(jìn)制"",M1.this);

            ? ? ? ? ? ? return;

            ? ? ? ? ? ? }

            ? ? ? ? ? ? if( MainActivity.rfidreader.ISO14443A.YW_RequestCard(MainActivity.rfidreader.ISO14443A.REQUESTMODE_ALL)<0)return;

            ? ? ? ? ? ? ?

            ? ? ? ? ? ? byte[] CardNo=MainActivity.rfidreader.ISO14443A.YW_AntiCollideAndSelect(MainActivity.rfidreader.ISO14443A.MULTIMODE_ONE);

            ? ? ? ? ? ? ?

            ? ? ? ? ? ? if(CardNo==null)return;

            ? ? ? ? ? ? txtCardNo.setText(""卡號(hào):"" + MainActivity.bytesToHexString(CardNo));

            ? ? ? ? ? ? ?

            ? ? ? ? ? ? byte KeyMode=MainActivity.rfidreader.ISO14443A.Key_B;

            ? ? ? ? ? ? if(rbKeyA.isChecked())KeyMode=MainActivity.rfidreader.ISO14443A.Key_A;


            ? ? ? ? ? ? if(MainActivity.rfidreader.ISO14443A.YW_KeyAuthorization(KeyMode, BlockID, MainActivity.HexStringtoBytes( edtKey.getText().toString()))<0)

            ? ? ? ? ? ? {

            ? ? ? ? ? ? MainActivity.dialog(""密鑰認(rèn)證錯(cuò)誤"",M1.this);

            ? ? ? ? ? ? return; ? ? ? ? ? ? ?

            ? ? ? ? ? ? }

            ? ? ? ? ? ? ?

            ? ? ? ? ? ? byte[] Data = MainActivity.rfidreader.ISO14443A.YW_ReadaBlock(BlockID);

            ? ? ? ? ? ? if(Data==null)

            ? ? ? ? ? ? {

            ? ? ? ? ? ? MainActivity.dialog(""讀取塊失敗"",M1.this);

            ? ? ? ? ? ? return;

            ? ? ? ? ? ? }

            ? ? ? ? ? ? ?

            ? ? ? ? ? ? edtData.setText(MainActivity.bytesToHexString(Data));

            ? ? ? ? ? ? MainActivity.rfidreader.ReaderHardware.YW_Buzzer(5, 5, 1);?

            ? ? ? ? ? ? }

            });

            Button button2 = (Button) findViewById(R.id.btnwritedata);

            button2.setOnClickListener(new View.OnClickListener() {

            ? ? ? ? ? ? public void onClick(View v) {

            ? ? ? ? ? ? txtCardNo.setText("""");

            ? ? ? ? ? ? ?

            ? ? ? ? ? ? ?

            ? ? ? ? ? ? int BlockID = MainActivity.ValidInt( edtBlockID.getText().toString() , 63);

            ? ? ? ? ? ? if(BlockID<0)

            ? ? ? ? ? ? {

            ? ? ? ? ? ? MainActivity.dialog(""塊號(hào)必須是0-63"",M1.this);

            ? ? ? ? ? ? return;

            ? ? ? ? ? ? }

            ? ? ? ? ? ? ?

            ? ? ? ? ? ? if(!MainActivity.ValidHexString(edtKey.getText().toString(), 6))

            ? ? ? ? ? ? {

            ? ? ? ? ? ? MainActivity.dialog(""密鑰必須是6字節(jié)16進(jìn)制"",M1.this);

            ? ? ? ? ? ? return;

            ? ? ? ? ? ? }

            ? ? ? ? ? ? ?

            ? ? ? ? ? ? if(!MainActivity.ValidHexString(edtData.getText().toString(), 16))

            ? ? ? ? ? ? {

            ? ? ? ? ? ? MainActivity.dialog(""數(shù)據(jù)必須是16字節(jié)16進(jìn)制"",M1.this);

            ? ? ? ? ? ? return;

            ? ? ? ? ? ?

            相關(guān)聯(lián)的產(chǎn)品
            YW-605RA
            YW-605RA

            串口射頻卡RFID讀寫器

            USB免驅(qū)動(dòng)IC卡讀卡器,支持Windows,安卓和linux,型號(hào)YW-605RA

            高頻RFID讀寫器,Linux讀卡器

            YW-605HA
            YW-605HA

            USB免驅(qū)IC卡讀卡器發(fā)卡器YW-605HA

            USB免驅(qū)動(dòng)IC卡讀卡器,支持web,安卓和linux,型號(hào)YW-605HA

            高頻RFID讀寫器,WEB讀卡器,安卓讀卡器,Linux讀卡器

            YW-607HC
            YW-607HC

            NFC讀寫器YW-607HC

            支持web瀏覽器,windows,安卓,linux的NFC讀寫器YW-607HC

            高頻RFID讀寫器,WEB讀卡器,安卓讀卡器,Linux讀卡器

            RFID讀寫器,IC卡讀卡器, 智能卡讀卡器,RFID讀卡器, 電子標(biāo)簽,CPU卡讀寫器,讀卡模塊
            北京友我科技有限公司 版權(quán)所有 (C)2025-2025
            客戶服務(wù)中心信箱:[email protected]
            熱線直撥: 010-57049038 18910685939 電話微信:13691531038,13671114914
            京ICP備14016005號(hào)
            微信掃一掃聯(lián)系我們

            微信掃一掃聯(lián)系我們

            友我科技

              <td id="n3ws3"></td>
                    <th id="n3ws3"></th>
                      <b id="n3ws3"><menuitem id="n3ws3"></menuitem></b>
                      <del id="n3ws3"><form id="n3ws3"></form></del>
                      <b id="n3ws3"><menuitem id="n3ws3"></menuitem></b>
                    1. <dd id="n3ws3"><dl id="n3ws3"></dl></dd>
                      黄色一级大片 | 乱伦小说五月天 | 黄色在线免看 | 色婷婷啪啪啪 | 女子高潮视频免费观看 |