Augustin Julien
Dec 03, 2018
3:20 pm

NFC stops scanning on Samsung devices

I'm developping an app for Samsung devices with an activity that has to handle a NFC tag..

This activity is called when the app is launched and on resume.

I noticed that, when the phone stays awake with the NFC tag connected to it, after a while the device stops recognizing/scanning for NFC tags.

After trying with some other applications from Play Store, I noticed that this doesn't happen only with my app.

All I can do to make it work again is to switch phone's screen on/off or to switch nfc on/off.

I tried different ways to fix it, as to keep the cpu running, but none of these methods worked :

PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Tag"); wl.acquire();

and

getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

 

I'm working over Samsung Galaxy XCover 3 and XCover 4.

Thanks in advance

Jenna Slomowitz
Dec 05, 2018
11:28 pm

Hello Augustin,

This forum is primarily for help with the Knox SDKs. For general questions related to android development please use https://developer.samsung.com/forum/en sp we can provide you with our best support.

-Jenna