Android, the registration of NDEF message handlers is done via the Android 清单文件 . This means the application has to provide an AndroidManifest.xml file with proper NFC 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>
When the application is started it has to register an message handler with registerNdefMessageHandler() The first NDEF message arriving in the handler is the message that started the application. See the 软木板 application for an example.
Supported tag types in Android are NDEF_DISCOVERED and ACTION_TAG_DISCOVERED with TagTechnology NdefFormatable or Ndef. If the application register other types in the Android 清单文件 the application will be started, but the tag will never get delivered to the handler. The handler should be registered as early as possible. If the application has not registered a handler, the application will be started every time a new tag is in range and the Android device end up running multiple instances of the application.