study this post:
Hi Guys I have a question regarding the sound produced when a NFC tag is read (which appears to be generated by the OS) - Can it be removed or changed? I think it maybe useful to give the reason why I am asking this question - As removing a feedback sound which helps the user to know something...
www.b4x.com
somewhere in there is a link to a project that uses enablereadermode. if that's what you think you have to have.
i don't know how you've set up your app and exactly what you mean by "options", but i don't think you need enablereadermode
to do what you're looking to do. and depending on how you've set up your app, using enablereadermode may not help.
enableForegroundDispatch only guarantees that if your app is running in the foreground it will receive any tag discovery attempt
(even if there are other apps on the device that might take precedence). it has nothing to do with whether your app is
launched when a tag is discovered. for that matter, neither does enablereadermode.
in theory, you set up the conditions under which your app is launched when a tag discovery is made. if other apps have done
likewise, your app and the others will be suggested by the os to handle the discovery. if your app happens to satisfy uniquely
the discovery (or if your app is the only way), you get the call. so, nothing to do with enableforegrounddispatch or enablereadermode.
if you've set the manifest up, enableforegrounddispatch and enablereadermode are irrelevant.
the conditions under which your app is called are detailed in your manifest. this is discussed at length in android's nfc documentation
and in multiple SO postings. you don't indicate whether you already have this set up or not. it's not too complicated, and it works.
a typical example would be:
AddPermission(android.permission.NFC)
AddActivityText(main,<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="geo" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfclist2" />
<intent-filter>
<action android:name="android.nfc.action.TAG_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
)
basically, these are the conditions under which i want my app to be launched.
note the line:
android:resource="@xml/nfclist2" />
you set "nfclist2" (or any name you want) in your res/xml folder.
if you don't have an xml folder, make one.
"nfclist2" (or whatever name you choose) looks like this:
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<tech-list>
<tech>android.nfc.tech.NfcA</tech>
</tech-list>
</resources>
android's documentation and SO posts will explain more. it's all spelled out.
to be on the safe side, the xml folder and nfclist2 (or whatever name you choose)
should be read only. i think the compiler may clobber them otherwise. i forget.