question

tjcorcoran avatar image
tjcorcoran asked ·

NFC Dead Object

Frequently NFC service is not working in android app .,
Here is link of nfc utils code :
https://github.com/shaelhaldkar/BpNFCDemo

We are using NFC scanning in multiple times, in multiple screen, but when we redirect to another screen , nfc service dead.

Clover Android SDKRemote Pay Android
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ketpat avatar image
ketpat answered ·

We are working on fixing the NFC read flakiness that you have observed.

Flex 2 fix is ready and will be soon along with our usual software release.

We have not yet narrowed down the issues in Flex 1 and Mini 2. In the meanwhile there are some other things I would recommend you incorporate in your app


1) enableReaderMode is not supported by Clover SDK. enableForegroundDispatch and disableForegroundDispatch in onResume and onPause of the Activity are the only methods available to enable and disable the NFC field

2) You should add a broadcast receiver listening for ACTION_ADAPTER_STATE_CHANGED. Clover devices use that state machine differently.
STATE_TURNING_ON - non-payment NFC is available on the device, field is off
STATE_ON - non-payment NFC is available on the device, field is on

STATE_OFF - non-payment NFC is not available on the device


10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ketpat avatar image
ketpat answered ·

Android NFC on Clover devices is not capable of handling rapid on and off of the NFC adapter (which is what happens when there are multiple Activities using NFC in succession) . Clover devices can only handle one Activity reading NFC.

1 comment
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I tested with single activity but still getting same issue , sometime it's reading for 3 times, sometime its reading 6 time.So its not guarantee that it is reading tag continuously.
In our application we need to read NFC tag continuously .
Also CloverCFPActivity has been deprecated , and not provide implementation with fragment .

I check with android sdk (without clover SDK) , but it is also not reading tag continuously.
https://github.com/andijakl/NfcDemo

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community