Qt NFC on Android#
Notes on Nfc for Android.
Automatically Launching NDEF Message Handlers on Android#
Android provides the possibility to automatically launch the application when touching the NDEF tag.
<intent-filter> <action android:name="android.nfc.action.NDEF_DISCOVERED"/> <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="text/plain"/> </intent-filter>
With this intent-filter enabled, the application will be automatically started once the NDEF NFC tag is touched.
It’s important to design your application in such a way that all the GUI is connected to the NFC classes before the target detection is actually started. Otherwise it will be impossible to show the information from the tag that caused application startup.
It’s important to touch the tag long enough for the application to start and read the information. If the tag is lost during application startup, no data will be available, and the tag needs to be touched again.
See Annotated URL application as an example.
Supported Tag Types#
If the application registers other types in the Android manifest file , the application will be started, but the tag will never be processed.