nfc

Android Beam - payload transfer from both devices when only one Touch To Beam?

青春壹個敷衍的年華 提交于 2019-12-06 17:21:28
问题 Ok, I watched the Google I/O from 2011 presentation on NFC on peer to peer. The demo was done on Gingerbread and using the application Sticky Notes found Now in this demo, both device the onNewIntent() was called at the same time so both devices are trying to share information to one another. On ICS and above, you have Android Beam.. With Android Beam, you have to touch to trigger the onNewIntent() event that will send the NDef message across. Now the problem with this is that now to trigger

Android nfcv.transceive() throws an exception

大城市里の小女人 提交于 2019-12-06 16:38:37
I wrote an Android app that uses the transceive() function to communicate with an NFC-V card. My problem is that line byte[] response = nfcv.transceive(command) always throws a tag lost exception. Could someone help me? String action = intent.getAction(); Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); NfcV nfcv = NfcV.get(tag); if(nfcv != null) { Toast.makeText(this, "nfcv detected", Toast.LENGTH_LONG).show(); } try { nfcv.connect(); Toast.makeText(this, "connected", Toast.LENGTH_LONG).show(); byte[] command = new byte[]{ (byte) 0x00, // Flags (byte) 0x20, // Command: Read single

How send NfcA command to the MIFARE card?

人盡茶涼 提交于 2019-12-06 15:44:06
I'm writing an Android application. I'm trying to send NfcA low-level commands (in my case: HALT and WAKE-UP) to my Mifare Plus S card. The NfcA tech is for "low-level" access to ISO 14443 Type A tags (i.e. the proprietary protocol as mentioned in ISO 14443-3). This is part of my code: protected void onNewIntent(Intent intent) { if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())) { tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); UID = Utils.byteArrayToHexString(intent.getByteArrayExtra(NfcAdapter.EXTRA_ID)); } NfcA nfca = null; try { Log.e(TAG, "WakeUpCMD and

How to access a MIFARE Classic card that uses the MIFARE Application Directory structure?

牧云@^-^@ 提交于 2019-12-06 14:40:53
问题 How can I make authenticate and read data from a MIFARE Classic card that is formatted with the MIFARE Application Directory structure? I'm using Android. 回答1: See NXP's application note on the MIFARE Application Directory. Typically, in order to read data from a MIFARE Classic card that makes use of the MAD, you would do something like the following: Authenticate to sector 0 (MAD sector) using key A A0 A1 A2 A3 A4 A5 (the public MAD read key). Read block 3. Based on the general purpose byte

Android NFC, do a null check in onCreate?

南楼画角 提交于 2019-12-06 14:38:04
问题 I have code to initialize my NFC adapter, but I am not sure how to intialize the variables during the onCreate. The app can be initialized whether an NFC TAG is in proximity or not, ie. if someone simply opened the app. So when I get down to this line NfcV nfcMessage = NfcV.get(new TagGet().getTag()); it crashes because it is null, there is no tag there if you just load the app on your own. How do I check here for != null I'm not sure which part to check or how to structure this code. The

NFC Android wear (Huawei watch 2.0)

为君一笑 提交于 2019-12-06 14:31:11
问题 I am new to Android Wear development (standalone application) and currently building an NFC reader for wear. The problem I am facing is with the function adapter.enableForegroundDispatch(activity, pendingIntent, filters, techList) Whenever I run my code it is throwing an "unsupported exception" in the onResume method. ( The same piece of code works perfectly fine on the phone ) From what I have understood, in order to detect a tag the application needs to be in the foreground which is done by

How to do NFC peer to peer connection in android? [closed]

一笑奈何 提交于 2019-12-06 14:17:42
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I need to do peer to peer connection between two nfc enabled device, i need some tutorial to do it if anyone done it send me link or explain. That sample is old and uses deprecated APIs (which are still needed though to support GB).

Unable to authenticate to a MIFARE Classic tag used as NDEF tag

∥☆過路亽.° 提交于 2019-12-06 13:47:53
问题 I'm using an ACR 1255U-J1 as external reader connected through Bluetooth. The library I use to access the reader is acsbt-1.0.0preview7. I use the following commands to authenticate to sector 1 (block 4) of a MIFARE Classic tag: FF 82 0000 06 FFFFFFFFFFFF FF 86 0000 05 01 00 04 60 00 When I authenticate to an empty MIFARE Classic tag (with manufacturer default configuration), I receive the response status word 9000 . This indicates that authentication was successful. However, when I try to

Android nfc to read card from samsung nexus

…衆ロ難τιáo~ 提交于 2019-12-06 13:37:48
I want to read a card from Samsung Nexus phone but the android nfc api does not provide enough options. i've also tried using a third party api names "open nfc" but the it gives error of not supporting the api. Can anyone provide me the code to read data from a card. I have the code to read a tag but not to read a card. Here is the link to download the open nfc api. http://sourceforge.net/projects/open-nfc/files/Open%20NFC%204.3%20beta%20%2810381%29/ Any help is appreciated. This is the code i used. Its giving an error of opennfc failing... public class NFCone extends Activity implements

Android Application Installed but won't open on device

冷暖自知 提交于 2019-12-06 13:34:32
I created an application on Android. I am developing it on eclipse with ADT. It is about nfc. For the moment it only reads and writes tag. I run my application on my mobile device for testing and it works well. So it compiles well and runs well on my Xperia Z1 Sony, however when i unplug my phone and install the apk on it i have a problem : The install runs well but then i have two choices "Terminated" or "Open". The open is not clickable... I go to settings->Application->installed and i see my app that is install. I can force stop clear cache but not open it... I can't understand why. It runs