[Atrix 4G Android Development] sendust7:
SuperLite NFC (Near Field Communication) and Battery Life

Are you experiencing unusually short battery life on SuperLite? It turns out that I retained a feature from the Galaxy S2 called NFC or “Near Field Communication”…

http://developer.android.com/guide/topics/connectivity/nfc/index.html

NFC is a two-edged sword, though big plans are in the works according to this 13-page blog devoted entirely to NFC: http://www.near-field-communication.us/nfc-pro-con.html

However because SuperLite’s NFC (/system/app/NFC.apk) is not native to Atrix, I wasn’t quite sure what to expect by keeping it on board. But I found out soon enough… After installing Boot-Time Auto-SuperLog: http://xdaforums.com/showthread.php?t=2232502 my logs began to reveal a correlation between SuperLite’s NFC app and battery drain. Anytime your device tries to bind with another device, it can drain the life right out of your battery at a dizzying rate.

My log buffers were stacking up like crazy...

​

I reckoned something was amiss, so I opened the dmesg/logcat files and discovered that NFC was making numerous attempts to bind. And my NFC ON/OFF switch located in Settings > More… > NFC seemed inoperable as there was no feedback in the checkbox. So without logcat and/or dmesg, I could not readily tell what NFC was doing.

Even if NFC did work on Atrix, security issues come to mind: If we lose our phone, our personal information could be compromised --- though I am confident experienced Linux hackers would find other means. And I personally don’t need NFC since other (possibly more capable) wifi apps are available to fill the void (see below: Some Alternatives to NFC). So I disabled it on my Atrix using Root Explorer, which is very easy to do:

1. Navigate to /system/app and tap on "Mount R/W" near top right

2. Long press on NFC.apk and rename to NFC.apk.bak

3. Remount /system/app as read-only​

​

And...voila, without even needing a reboot, my Atrix immediately calmed down to the point of actually getting cold :D -- even with wifi on. And Bluetooth still worked.

And battery life was much improved (with good wifi signal).​

Some Alternatives to NFC

For scanning barcodes and related things, there are several apps available e.g. https://play.google.com/store/apps/details?id=me.scan.android.client&hl=en

For file transfer, we could use FTP. There are several variants of FTP server on Google Play, but I keep coming back to this one, which seems to have good security: https://play.google.com/store/apps/details?id=lutey.FTPServer&hl=en

On the client (computer) side, I use FileZilla (free): https://filezilla-project.org/

Or if the client is another Android device, we could try AndFPT: https://play.google.com/store/apps/details?id=lysesoft.andftp&hl=en

These server/client configurations yield a GUI-based wireless file transfer protocol with adjustable security levels. These may actually be more secure than NFC...

Anyway, I thought it would be good to pass this info along. My next version of SuperLite for Atrix will address NFC issues.

References

http://www.ghacks.net/2012/10/16/tu...hone-to-save-battery-and-make-it-more-secure/

http://www.examiner.com/article/nfc-is-a-battery-problem-to-be-solved

http://xdaforums.com/showthread.php?t=1870689