NFC on Android
-
-
Hi,
No, it means that your application must be the current active one in order to get something from the NFC reader.
-
An example of my code is:
m_manager = new QNearFieldManager(this);
if (!m_manager->isAvailable()) {
qWarning() << "NFC not available";
return;
}QNdefFilter filter; filter.setOrderMatch(false); connect(m_manager, SIGNAL(targetDetected(QNearFieldTarget*)), this, SLOT(targetDetected(QNearFieldTarget*))); connect(m_manager, SIGNAL(targetLost(QNearFieldTarget*)), this, SLOT(targetLost(QNearFieldTarget*)));
I also write this into manifest in order to be the current one:
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain"/>
</intent-filter> -
Did you try to run one of Qt's NFC examples ?
-
What example i can use to run it in Android?
The only one is to read, that is QML CorkBoard example, and it can only read android:mimeType="text/plain"And i think the example to write records, NFCeditor, can only generate text records not encoded as mime.
So if i modify that examples to make them "run", i will end up having the same as in my application that is not working.
In the other hand, i found out a problem in my code, mime must be lowercase. If this can help somebody
-
I write because my thread with same topic...
https://forum.qt.io/topic/80451/nfc-android