Solved Nfc & foreground app
-
Hi all,
For an armv7 mobile app, I used the NFC interface. I just need to read the smartcard identifier. My app only uses the QNearFieldManager object & the targetDetected signal. When the signal fires, I get the uid through the uid() method.
It works proprely... but a starting behavior is strange & I don't understand how to solve it.
When I launch the app & that I approach a NFC tag, an other app seems to take the information (my application does not see the tag). If I reduce my app & then I maximize it, everything works nice.
I added the intent section in the manifest before the default one, but the problem is already present. On some devices, I need to click the screen on the app to fix the problem (focus ?)... the problem is not systematic. I have a little trouble understanding knowing that an application that launches theoretically has the focus. I tried with a Galaxy S8 (same pb).
Target : Qt 5.9.2, QtcCreator 4.4.1, NDK r11c, Android 5.1.1
Thank you very much for your proposals and / or ideas about that problem.
Sincerely,
David. -
@daviraim don't know if this is related, but AFAIK you should use NDKr10e https://wiki.qt.io/Qt_for_Android_known_issues
-
Hi forum !
Thanks, but the problem is always present with the NDKr10e.
Any other suggestions/ideas ?
Thanks a lot.David.
-
Same behaviour with NDKr15. It still works after reducing & expanding the application. Is there something to specify in the manifest to give the focus to the app ?
In other words, what can happen when the application is reduced/maximized and which miss when launching the application ?
Thanks a lot.
David. -
Hi all,
Same problem with the qml poster Qt examples (Examples/Qt-5.9.2/nfc/poster).
Can anyone try on his side ?
Thanks a lot.David.
-
I found a solution to that problem.
To solve that issue, we just need to start the NFC module with a slight delay (I tested with 100ms).
So, now I launch the application & 100ms later I create the QNearFieldManager object and then I start the detection (startTargetDetection). There is no need for a delay between the manager creation & the start detection method call.Thanks to all.
David.