nfc

Disable NFC functionality from within the app

◇◆丶佛笑我妖孽 提交于 2019-12-11 05:37:51
问题 The issue I'm trying to solve is as follows: An NFC tag will trigger my app, from which I'm launching another app. What sometimes will happen is that the NFC tag will move and will be "re discovered" by the phone and launch my app once again. The moving of the NFC tag is something I can't control. This really ruins the experience. What I would ideally like to do is once my app is launched, NFC triggering will be disabled or paused, and once app is closed (OnDestroy()) I will enable / un-pause

I would like to understand the manipulation of NfcV ISO-15639

微笑、不失礼 提交于 2019-12-11 05:23:25
问题 I'm new in NFC Technology! I have difficulty understanding how to manipulate blocks. byte[] cmd = new byte[] { (byte)0x20, //FLAG (byte)0x21, //WRITE SINGLE BLOCK COMMAND (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, //UID (byte)0x00, //OFFSET (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 //DATA }; My questions about code above: What is a FLAG and what is its function? What is a UID and what is its function? in code the UID line has 8 "index"

How do i create an Tag object in android?

自作多情 提交于 2019-12-11 05:14:30
问题 I've been trying to find a way to instantiate the Tag object. I'm trying to do this so that i can simulate various types of Tags. Does anyone know how to get an instance of UltraLight object using Tag tag = ????? UltraLight obj = UltraLight.get(tag); Thank you 回答1: In the NFC app example for ICS source code, we can find some code such as: Bundle extras = new Bundle(); extras.putParcelable(Ndef.EXTRA_NDEF_MSG, ndefMsg); extras.putInt(Ndef.EXTRA_NDEF_MAXLENGTH, 0); extras.putInt(Ndef.EXTRA_NDEF

Open NFC Simulator hangs when pulling NFC Device #2

房东的猫 提交于 2019-12-11 05:00:05
问题 I'm currently experimenting NFC with android emulator and Open NFC. I have setup OpenNFC as described here P2P in Android using Open NFC virtual device, running 2 emulator instances then clicking "NFC Device #2" to simulate device touching. It works as expected, the tag is sent to the other device. The problem is when I double click "NFC Device #2" to simulate pulling, the NFC simulator always hangs. Anyone else having this problem? 来源: https://stackoverflow.com/questions/10290889/open-nfc

Trying to ignore all NFC intents while in foreground with enableForegroundDispatch

偶尔善良 提交于 2019-12-11 04:12:15
问题 I'm trying to get my app to ignore nfc commands while running - its launched by an NFC tag with an Android Application Record (AAR), and I dont want it to be able to be launched by that when its already running.. I've tried to carefully follow others examples, but the app is still able to be launched by AARs while running (in foreground). Manifest.xml: <application> <activity> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category

Android NFC read Tags issue. Activity starts each time on data received

流过昼夜 提交于 2019-12-11 03:52:23
问题 I have 2 issues with reading NFC Tags. First is Tag Read Activity creates each time when tag received. And second issue is activity opens in full screen window, not under Tab Host Activity, but first issue is worst. What do I do ( AndroidManifest.xml ): <activity android:name="readingActivity" > <intent-filter> <action android:name="android.nfc.action.TAG_DISCOVERED" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> and readingActivity.cs: @Override

Start Android application from NFC-tag with extra data

泪湿孤枕 提交于 2019-12-11 03:41:28
问题 I can start my application by simply putting the phone on a NFC-tag. But I would like to take the idea one step further. Imagine a simple time-tracking application with two NFC-tags. The first will start (and download) the application and register a starttime. The other will also start (and download) the application, but register a stoptime. My problem I'd like to solve is that I don't want my phone to know about these tags. The application should not need to have a list of tag-ids programmed

Android NFC: can we use intent filter with mime type? (android 2.3.3)

送分小仙女□ 提交于 2019-12-11 03:27:31
问题 I'm trying to start an activity when "tapping" a nfc tag containing a specific mime type. I made a tag with the mime type "text/plain", and added this in the manifest: <intent-filter> <action android:name="android.nfc.action.NDEF_DISCOVERED"/> <data android:mimeType="text/plain" /> </intent-filter> If I tap a nfc tag, nothing happen, even if the intent seems right, here is what I see in logs: 03-13 23:36:56.871: INFO/ActivityManager(114): Starting: Intent { act=android.nfc.action.NDEF

AndroidApplicationRecord and Google Analytics

雨燕双飞 提交于 2019-12-11 03:23:25
问题 I'm developing an application which can be installed and opened via an AndroidApplicationRecord (AAR, see http://developer.android.com/guide/topics/nfc/nfc.html). If a user installs the app coming from other sources I'm adding a Google Analytics referrer to the Google Play link in order to track the source of installation. Is there a way to add this referrer to the AAR or as an additional NDEFRecord so that this source can be tracked as well? 回答1: The process behind the AAR is completely

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