ndef

How to read NDEF Msg and Records of NFC tag?

▼魔方 西西 提交于 2019-12-13 00:44:50
问题 I am Working with Reading NDEF Msg and Records Here I have done with Reading ID by using this public class MainActivity extends Activity { // list of NFC technologies detected: private final String[][] techList = new String[][] { new String[] { NfcA.class.getName(), NfcB.class.getName(), NfcF.class.getName(), NfcV.class.getName(), IsoDep.class.getName(), MifareClassic.class.getName(), MifareUltralight.class.getName(), Ndef.class.getName() } }; @Override protected void onCreate(Bundle

Samsung Nexus S vs HTC - NFC Intent Filter + AAR

蓝咒 提交于 2019-12-12 18:26:28
问题 I save the AAR on my NFC-Tag. If I scan the TAG with the Nexus S (Android 4.1.1), i get the NfcAdapter.ACTION_NDEF_DISCOVERED and the NFCReaderActivity directly starts. If I do the same with the HTC X (Android 4.0.3), the application starts but I just get the android.intent.action.MAIN and so the NFCReaderActivity doesn't show up and the Tag isn't scanned. This works on Samsung Nexus S but not on HTC: <activity android:name=".activities.NFCWriterActivity"></activity> <activity android:name="

Android: How to make a NFC Tag Ready only for users and writable for me?

浪子不回头ぞ 提交于 2019-12-12 08:13:29
问题 I have an app that design personalized tags that, when it is detected by an android phone, launches another app with some content. It all works fine and I know how to make a read only nfc Tag. The problem is, I would like to make a NFC Tag only readable by users of the other app. But I also want , if necessary, modify these tags in order to be rewritten. But I want to prevent from users to do themselves. that's why a ndef.makeReadOnly() is not appropriate for me.. does anyone can help me ???

How to read NFC Tag through my Application if I wrote NFC Tag through my Application

橙三吉。 提交于 2019-12-12 05:59:28
问题 I am trying to operate the function of flash light which can be on/off through NFC tag. After writing tag, I tried to set up if a certain information would be read on broadcastReceiver, Flash light should be on/off. However, the receiver never responded. I don't know Why.. So, what I really want to know is following below as "My application can read the information first where is written in the tag through My application. " as you saw below codes, I tried to operate the function. This code

NFC P2P tag intercept

本小妞迷上赌 提交于 2019-12-12 05:41:08
问题 I am building an Android app using Eclipse and Android SDK. I would like to implement an NFC P2P function in my app in the sense that when you place the 2 phones back to back, both send a string and receive a string automatically. This would of course happen in a separate activity. I have managed to send a custom tag (String) but have been unable to intercept it and use it afterwards in the app code. How can I do this? This is what I have so far: public class MainActivity extends Activity {

Why I'm getting IOException when making NFC tag read only

三世轮回 提交于 2019-12-11 12:12:04
问题 I'm doing my NFC writing in the AsyncTasks doInBackground() . When I write NdefRecord it works well but when I'm trying to make tag read only I'm getting IOException . Here is the code where exception occurs: if (readOnly && !ndef.canMakeReadOnly()) { throw new NdefCantMakeReadOnlyException(R.string.cant_make_read_only); } else if (readOnly) { ndef.makeReadOnly(); //IOException } This makeReadOnly works with Mifare Ultralight (MF0ICU1) tags. 回答1: Browsing through the Android 4.4.2 source (I

Android AAR + Intent Filter: clarification

落爺英雄遲暮 提交于 2019-12-11 08:25:13
问题 Based on this documentation available at Android NFC doc: If a tag contains an AAR, the tag dispatch system dispatches in the following manner: Try to start an Activity using an intent filter as normal. If the Activity that matches the intent also matches the AAR, start the Activity. If the Activity that filters for the intent does not match the AAR, if multiple Activities can handle the intent, or if no Activity handles the intent, start the application specified by the AAR. If no

Launch app via NFC and send a NDEF message back when started

↘锁芯ラ 提交于 2019-12-11 07:43:01
问题 I'm developing an Android app which interacts with other devices using NFC. This interaction consists of 2 steps basically: When the device receives a specific URI by NFC from other device, the app is launched. When the app starts, it sends a NDEF message back to the other device. For the first step, I have added the following lines to the AndroidManifest.xml file. That way, the MainActivity will be launched when the device receives a URI of type myprotocol:something : <intent-filter> <action

How to read and write to NFC tags in NDEF format using C# compatible with Android?

旧街凉风 提交于 2019-12-11 06:09:12
问题 I am working with Mifare Ultralight C tags and write data in NDEF format to them. Am using NDEF-NFC library to create raw bytes for my NDEF message. My NDEF message is var spRecord = new NdefTextRecord { Text = "1", LanguageCode = "en" }; var msg = new NdefMessage { spRecord }; The output I get is D1 01 04 54 02 65 6E 31 (hexadecimal). If I write this byte array to the tag as-is: After reading from the tag and using the same NDEF-NFC library I am able to convert back to the desired NDEF

Catch NFC NDEF_DISCOVERED intent from a service

柔情痞子 提交于 2019-12-11 02:52:23
问题 I have a service which is always running in the background, is there a way that I can catch an NDEF_DISCOVERED intent filter in my service? So that once my two devices are ready to beam I can catch that code in a service and manipulate it as I need too? 回答1: The NFC intents, that is android.nfc.action.NDEF_DISCOVERED, android.nfc.action.TECH_DISCOVERED, and android.nfc.action.TAG_DISCOVERED, are only sent to activities. Thus, you cannot catch them from a service directly. However, you could