我想在 Android 上编写我的第一个 NFC 应用程序。为此,我使用 Android 开发人员链接:http://developer.android.com/guide/topics/nfc/index.html http://developer.android.com/guide/topics/nfc/index.html
为了指定支持的技术,您必须创建一个如下所示的 xml 文件:
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<tech-list>
<tech>android.nfc.tech.IsoDep</tech>
<tech>android.nfc.tech.NfcA</tech>
<tech>android.nfc.tech.NfcB</tech>
<tech>android.nfc.tech.NfcF</tech>
<tech>android.nfc.tech.NfcV</tech>
<tech>android.nfc.tech.Ndef</tech>
<tech>android.nfc.tech.NdefFormatable</tech>
<tech>android.nfc.tech.MifareClassic</tech>
<tech>android.nfc.tech.MifareUltralight</tech>
</tech-list>
</resources>
我的问题是,在标签处我收到以下错误:“错误:找到需要项目的标签技术列表”
我的应用程序的目标是2.3.3。我认为这必须朝着这个目标努力......
任何想法?
Thanks!
我的应用程序的 AndroidManifest.xml 文件中接收 NFC 意图的活动的片段
<activity
android:name=".activity.ClientActivity"
android:screenOrientation="portrait"
android:label="@string/app_name"
android:description="@string/app_name"
android:icon="@drawable/ttlogo">
<intent-filter>
<action
android:name="android.nfc.action.TECH_DISCOVERED"/>
</intent-filter>
<meta-data
android:resource="@xml/nfc_tech_filter"
android:name="android.nfc.action.TECH_DISCOVERED" />
<intent-filter>
<action
android:name="android.nfc.action.TAG_DISCOVERED" />
<category
android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action
android:name="android.intent.action.VIEW" />
<category
android:name="android.intent.category.DEFAULT" />
<data
android:scheme="http"
android:host="www.ttag.be" />
</intent-filter>
</activity>
包含过滤器定义的文件位于 res/xml/nfc_tech_filter.xml 中,如下所示
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Touchatag tag -->
<tech-list>
<tech>android.nfc.tech.NfcA</tech>
<tech>android.nfc.tech.Ndef</tech>
<tech>android.nfc.tech.MifareUltralight</tech>
</tech-list>
<!-- DESFire tag -->
<tech-list>
<tech>android.nfc.tech.NfcA</tech>
<tech>android.nfc.tech.IsoDep</tech>
<tech>android.nfc.tech.NdefFormatable</tech>
</tech-list>
<!-- Any Tag -->
<tech-list>
<tech>android.nfc.tech.NfcA</tech>
</tech-list>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)