nfc

Getting NDEF message from tag freezes Android app

情到浓时终转凉″ 提交于 2019-12-24 20:48:19
问题 I'm trying to read an NDEF message from an NFC tag. The detection of the tag works correctly. For reading the NDEF data from the tag I'm running a TimerTask. The task polls the NDEF message from the tag with getNdefMessage() every 900 ms and updates the UI. The procedure works perfect until I remove the phone. Than the app freezes without a logcat error message. Does anyone have an idea why this happens? package com.example.infcdemo; import java.io.IOException; import java.util.Timer; import

NfcAdapter.getDefaultAdapter(this) returns null but NFC works

心已入冬 提交于 2019-12-24 17:46:04
问题 my app uses NFC reading on background and on foreground. For user info I use CountDownTimer(120 * 1000, 5 * 1000) in my activity and method onTick(long l) to check NFC status each 5 seconds. Sometimes (on Android 4.2.2, my client says, it never happend to me) NfcAdapter.getDefaultAdapter(BaseActivity.this) returns null but background and foreground NFC reading still works! Turning off and on doesn't help. Re-install helps. BG reading via manifest: <activity android:name=".activity

NFC disable adapter

荒凉一梦 提交于 2019-12-24 16:12:29
问题 Is it possible to disable the NFC adapter immediately after a scan within millisecs? I want to prevent duplicate scans of the same tag. I have proved though testing that the same tag can be scanned twice within millisec by hovering the phone over a tag. I've looked at the NFC api but can't see anything that disables the adapter. My app uses the NFC statically so i don't actually use an instance of the NFC adapter class but i would change my if i could reap the benefits of disabling the

how to intercept NFC tag before onNewIntent executes

可紊 提交于 2019-12-24 13:53:01
问题 I have an app that captures NFC tags. The problem i have had in the past is that users hover over the tag in an unsteady manner causeing the NFC adapter to trigger twice. I have done a few things to counter this. manifest: <activity android:name=".NfcActivity" android:screenOrientation="portrait" android:launchMode="singleTask" android:noHistory="true" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation"> <intent

How to make an Android phone act like a contactless (NFC) terminal

倾然丶 夕夏残阳落幕 提交于 2019-12-24 13:40:33
问题 In order to help debug a HCE app I would like to make an Android phone act as a contactless terminal. Is this possible without rooting the phone and using NFCProxy? (http://sourceforge.net/projects/nfcproxy/) i.e. I have two phones and want to run my app on one while making the other act as a reader. 回答1: This is only possible if your reader Android device (the one that acts as contactless terminal) has Android 4.4 or later. The problem is that Android's HCE capabilities run in parallel with

NFC reader/writer mode - is it only for tags?

元气小坏坏 提交于 2019-12-24 11:35:09
问题 I'm new to NFC and fairly new to programming as well. I'm doing some research on NFC for a project that Im working on. I have an embedded device and a token that I need to get to communicate. I need to have the token be the active device and the embedded device being passive. I cannot use an NFC tag in the embedded device, but need to an NFC chip. So both the token and the embedded device will have a chip, token chip working in active mode and embedded device chip working in passive mode. My

Byte array gets truncated when writing to memory of RFID tag using Adafruit PN532 library

杀马特。学长 韩版系。学妹 提交于 2019-12-24 10:35:27
问题 I'm trying to write a byte array that was converted from a hex string into the memory of an NTAG203 RFID tag. I'm using a Raspberry Pi 3, a PN532 chip and the Adafruit PN532 python library. hex_string = '59e7168f267df300018e15b0' formatted_hex = bytearray.fromhex(hex_string) byte_data = bytearray(16) byte_data[3:15] = formatted_hex if not pn532.mifare_classic_write_block(4, byte_data): print('Error! Failed to write to the card.') sys.exit(-1) When I do pn532.mifare_classic_read_block(4) to

Enable/Disable counter for NTAG213

我与影子孤独终老i 提交于 2019-12-24 10:19:55
问题 MifareUltralight mifareUltralight = MifareUltralight.get(tag); byte[] toggleCounterCommand = new byte[]{(byte)0xA2, // NTAG213 command to write (byte)0x2A, // page 42(dec) 2A(hex) (byte)___};// not sure what to put here. The data sheet for NTAG213 says that the 0th byte of page 42 has the access information. The 0th byte is structured in the following way : 7 6 5 *4* 3 2 1 0 PROT CFGLCK RFUI *NFC_CNT_EN* NFC_CNT_PWD_PROT AUTHLIM Setting the 4th bit to 0 or 1 should enable or disable the

is Card Emulation supported in Android with NFC?

一曲冷凌霜 提交于 2019-12-24 09:48:55
问题 I need to communicate over NFC (ISO14443) with some card reader. when i put my nexus S on Reader, logcat shows messages 02-18 13:24:00.691: DEBUG/NfcService(278): SE FIELD ACTIVATED 02-18 13:24:00.691: DEBUG/NfcService(278): Broadcasting Intent or theese , when card reader is trying to read 02-18 13:25:00.718: DEBUG/NFC JNI(278): > AID DETECTED 02-18 13:25:00.718: DEBUG/NFC JNI(278): > AID: 0102030405060708090000 02-18 13:25:00.722: DEBUG/NfcService(278): Card Emulation message 02-18 13:25:00

Reading phantom NFC tags via javax.smartcardio

十年热恋 提交于 2019-12-24 08:39:20
问题 I have an an old NFC reader for the tikitag web service (which was later renamed touchatag, and finally abandoned around 2012). Since the website is no longer available, I could no longer find the original tikitag/touchatag drivers. After some searching, I found this NFC reader is a generic ACS ACR122U USB reader, and installed a suitable driver from here. My system is Windows 7 (64-bits). First, I tried the NFC Tools library for high-level read and write access to NFC tags. I got an error