Qt NFC Androidで
AndroidでNDEFメッセージ・ハンドラを自動起動する
Android では、NDEF タグに触れたときにアプリケーションを自動的に起動することができます。
これは、適切なNFC インテント・フィルタを含むAndroid マニフェスト・ファイル(AndroidManifest.xml)を提供することで実現できます。
<intent-filter> <action android:name="android.nfc.action.NDEF_DISCOVERED"/> <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="text/plain"/> </intent-filter>
このインテント・フィルタを有効にすると、NDEF NFC タグがタッチされるとアプリケー ションが自動的に起動します。
注意: ターゲット検出が実際に開始される前に、すべての GUI が NFC クラスに接続され るようにアプリケーションを設計することが重要です。そうしないと、アプリケーショ ンの起動の原因となったタグからの情報を表示することができなくなります。
注: アプリケーションが起動し、情報を読み取るのに十分な時間、タグに触れることが重 要です。アプリケーションの起動中にタグが失われると、データは利用できなくなり、タグに再度触れる必要があります。
例として、注釈付きURLアプリケーションを参照してください。
サポートされるタグの種類
Androidでサポートされているタグタイプは、ACTION_NDEF_DISCOVERED、ACTION_TAG_DISCOVERED、およびTagTechnology NdefFormatableまたはNdefを持つACTION_TECH_DISCOVEREDです。
アプリケーションがAndroidマニフェストファイルに他のタイプを登録した場合、アプリケーションは起動されますが、タグは処理されません。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.