summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Schmertmann <Lars.Schmertmann@governikus.de>2020-03-17 13:05:58 +0100
committerLars Schmertmann <Lars.Schmertmann@governikus.de>2020-04-08 16:40:24 +0100
commit5b1119b82570ce3dd1f7f45601ebffe8e9ac14c3 (patch)
tree09dbbd93d46f67444f17fc0a1027399226ff34db
parent280cfd43012d1cfbfcd26fe57f633db3fc13a379 (diff)
Fix the documentation for QtNFC in services on Android
It is already possible to use QtNFC in Android services since Qt 5.9. Fixes: QTBUG-57646 Change-Id: Ib3d8a8101982cd9bf5e7c529d45491b49fede96d Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/nfc/doc/src/nfc-overview.qdoc15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/nfc/doc/src/nfc-overview.qdoc b/src/nfc/doc/src/nfc-overview.qdoc
index 6ac5c1dc..cb10b400 100644
--- a/src/nfc/doc/src/nfc-overview.qdoc
+++ b/src/nfc/doc/src/nfc-overview.qdoc
@@ -45,8 +45,19 @@ With the Qt NFC API typical use cases are:
The following sections describe how to use Qt NFC C++ classes and QML types for the above use cases.
-\note On Android, Qt Nfc only works in foreground applications. Android services are not supported which is due to
-API limitations on the Android side.
+\note On Android, the detection of new NFC tags only works in foreground applications. Android
+services do not support this because of API limitations on the Android side. The only way to use a
+\l{https://developer.android.com/reference/android/nfc/Tag}{Tag} in a service is to provide an
+\l{https://developer.android.com/guide/components/aidl}{AIDL} interface accepting the Tag and forward
+it to Qt as shown in the following example.
+
+\code
+ public void setTag(Tag pTag) {
+ Intent newIntent = new Intent();
+ newIntent.putExtra(NfcAdapter.EXTRA_TAG, pTag);
+ QtNative.onNewIntent(newIntent);
+ }
+\ endcode
\section1 C++ Overview