nfc

Reading and writing to NFC

强颜欢笑 提交于 2020-01-25 06:16:04
问题 I am writing an Android application to read and write to a tag. When I read everything's works fine, when i try to save data on the nfc tag, tag first read data and opens again activity, how to block reading from intent and save correctly data? I have an activity that runs 4 fragments, the reading code is in the activity and the mechanism of writing is called from fragment 回答1: For writing I would not use the enableForegroundDispatch method, it misleads the user to move the card out of range

安卓 API

自古美人都是妖i 提交于 2020-01-24 20:23:57
OpenGL 刚才我们谈到图像处理,在做图像处理我们不是可以用Canvas来绘制吗 OpenGL的好处:手机上做图像处理有很多方式,但是目前为止最高效的方法是有效地使用图形处理单元,或者叫 GPU;GPU 可以集中来处理好一件事情,就是并行地做浮点运算。事实上,图像处理和渲染就是在将要渲染到窗口上的像素上做许许多多的浮点运算。也就是说用GPU来分担CPU的工作,提高工作效率。 NFC是什么 近场通信(英语:Near Field Communication,NFC),又称近距离无线通信,是一种短距离的高频无线通信技术,允许电子设备之间进行非接触式点对点数据传输,在十厘米(3.9英吋)内,交换数据。这个技术由免接触式射频识别(RFID)演变而来,由飞利浦和索尼共同研制开发,其基础是RFID及互连技术。近场通信是一种短距高频的无线电技术,在13.56MHz频率运行于20厘米距离内。其传输速度有106 Kbit/秒、212 Kbit/秒或者424 Kbit/秒三种。目前近场通信已通过成为ISO/IEC IS 18092国际标准、EMCA-340标准与ETSI TS 102 190标准。NFC采用主动和被动两种读取模式。 说到NFC我们不得不提到RFID,你或许对RFID感到陌生,但它已经包围了我们了,饭卡、公交卡、门禁卡等等你用到的只要轻轻触碰一下就能支付或者做其它事情的卡都运用了RFID

Can't exchange data between Android phone and Arduino with NFC module, using HCE

你离开我真会死。 提交于 2020-01-23 03:27:06
问题 Please, I need any help to solve my problem. I can't exchange data normally between Android (4.4.2) phone and Arduino with NFC module, using HCE. I took example from Android samples, and slightly changed to return just IMEI number. public byte[] processCommandApdu(byte[] commandApdu, Bundle extras) { if (Arrays.equals(SELECT_APDU, commandApdu)) { String data = ((TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId(); return ConcatArrays(data.getBytes(), SELECT_OK_SW); }

Android NFC: Exception “transceive failed” when using transceive()

北城以北 提交于 2020-01-22 15:38:04
问题 I'm trying to communicate between a Samsung Galaxy S3 and a smartcard that supports NfcA and IsoDep (Mifare DESFire EV1). To do this, I enabled forgeground dispatch and started a task when a tag is discovered. The code in the task looks like this: IsoDep isoDep = IsoDep.get(tag); byte[] selectCommand = { (byte)0x00, // CLA (byte)0xA4, // INS (byte)0x04, // P1 (byte)0x00, // P2 (byte)0x0A, // LC (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,

Write NFC data on an tag with Android Studio

醉酒当歌 提交于 2020-01-22 03:39:07
问题 I'm creating an application in which I have to write a series of values that come to me from a file to an NFC card and I've been reading and I don't know where to really start, I have a few doubts. First of all I understand that the ideal is to create a class that handles the NFC, although I suppose this is optional and can be done in the same class. The problem is that the tutorials I see are only using activities and make use of the onNewIntent method. Being in a fragment I can not call

Android NFC - ndef.writeNdefMessage() throws IOException and erases tag data

為{幸葍}努か 提交于 2020-01-21 08:14:18
问题 My app uses the foreground dispatch system to allow a user to tap their NFC tag in order to perform a read-then-write operation on the tag. It works nicely if the user taps their tag properly (i.e., they tap it in the correct place on the phone and leave it connected for long enough), but if they physically remove the tag too early, then ndef.writeNdefMessage(...) throws an IOException. That means the write operation fails, which is fair enough. But the real problem is that the same failed

Formatting a Mifare Ultralight C to NDEF

只谈情不闲聊 提交于 2020-01-17 04:26:06
问题 I want to format a Mifare Ultralight C to handle NDEF messages. I have written the code below and it works just fine with the Mifare Classic 1K chips but it gets an IOExeption when i try and connect to the Ultralight C chip. NdefFormatable format = NdefFormatable.get(tag) if(format != null){ try { format.connect(); format.format(new NdefMessage(new NdefRecord(NdefRecord.TNF_EMPTY, null, null, null))); format.close(); Toast.makeText(getApplicationContext(), "Tag formated.", Toast.LENGTH_LONG)

Nfc and Intent-filter

感情迁移 提交于 2020-01-17 03:59:47
问题 I wrote a nfc text tag like this myscheme://company?page=2&poiId=140 Then i've created an Intent-filter like this in my manifest file in order to open my app (and then call a WS with informations from tag) <intent-filter> <action android:name="android.nfc.action.NDEF_DISCOVERED"/> <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="text/plain" android:scheme="myscheme" android:host="company"/> </intent-filter> If i remove scheme and host params from data tag so

NFC 介绍

回眸只為那壹抹淺笑 提交于 2020-01-16 07:31:07
1.概念 NFC (Near Field Communication),即距离无线通信技术。由飞利浦公司和索尼公司共同开发的NFC 是一种 非接触式识别和互联技术 ,一般频率在 13.56MHZ ,它是RFID与互联互通技术整合而来,具有低成本、方便易用和更富直观性特点,可在移动设备、消费电子类产品、PC 和智能控件工具间进行近距离无线通信。NFC 提供了一种简单、触控式的解决方案,可以让消费更简单直观的交换信息、访问与服务。 nfc是一种短距高频的无线电技术,在13.56MHz频率运行于 10厘米距离内 。其传输速度有106 Kbit/秒、212Kbit/秒或者424 Kbit/秒三种。目前近场通信已通过成为ISO/IEC IS 18092国际标准、ECMA-340标准与ETSI TS 102 190标准。NFC采用主动和被动两种读取模式。 NFC有三种工作模式: 1.主动模式 在主动模式下NFC终端可以作为一个读卡器,发出射频场去识别和读/写别的NFC设备信息。 2.被动模式 这个模式正好和主动模式相反,此时NFC终端则被模拟成一张卡,它只在其他设备发出的射频场中被动响应,被读/写信息。 被动通信模式 3.双向模式 在此模式下NFC终端双方都主动发出射频场来建立点对点的通信。相当于两个NFC设备都处于主动模式。 以被动模式为例: 启动NFC通信的设备,也称为NFC发起设备

How to make an android phone act as Contactless smart card?

萝らか妹 提交于 2020-01-15 07:46:31
问题 I would like to know how to make the android phone act as contactless card to transfer certain data to POS. Is there any specific Intent we should try to catch and how to communicate with that eternal POS via NFC. 回答1: I am afraid it is not directly possible. You need to enable NFC Card emulation which involves recompiling a custom firmware image. I am not aware if beyond Android 2.3.6 emulation is already enabled by default (so Google Wallet can be used). If you want to enable card emulation