So, after a considerable amount of time I finally managed to properly start the NFC module in SW3. It can do all things a module on your phone can do, however, it uses a lot of battery in the process.
Warnings:
Technical details:
Features:
The package does not include apps to read and write tags, emulate cards and use Android Beam.
Instaling:
Uninstalling:
Usage:
Example code to check NFC:
Thanks:
P.S. Some time later an in-depth article on how this stuff was done will be released. I'll post the link here.
Warnings:
- This package is for build LCA43 only (can be seen in Settings->About)
- Can screw up boot if you install this on a different build and/or customized system
- Future OTA updates can also corrupt your sytem. Restore to a stock ROM before installing them.
- Make backups of system and boot partitions before installing
- Uses insecure kernel (with SElinux disabled) and disables signature checks in services.jar
- Preview/development purposes only, it disables initial tag (used for quick pairing) and causes severe power consumption when NFC is active.
Technical details:
Features:
- Full NFC support (tag reading, writing, HCE (card emulation) and P2P (Android Beam))
- Configuration app to turn NFC module on and off
- Watchface to monitor current NFC module state
The package does not include apps to read and write tags, emulate cards and use Android Beam.
Instaling:
- If you need to omit certain components (like watchface), feel free to remove them from the package files
- Boot into recovery (I am using TWRP found here)
- Back up your system and boot partitions in case something goes wrong or you want to remove the package
- Push the package using adb:
Code:
adb push nfc.zip /sdcard/nfc.zip - Tap "Install" on the screen
- Locate nfc.zip
- Install it
- Boot into system
Uninstalling:
- Restore system and boot partitions from your backup
Usage:
- You can control your NFC module using NFC Configuration app
- If you want to monitor NFC module state all the time, use NFC Status watchface (long tap on the screen to set up)
- To view a tag install tag editing app via adb
Example code to check NFC:
Code:
NfcManager nfcManager = (NfcManager)this.getBaseContext().getSystemService(Context.NFC_SERVICE);
NfcAdapter nfcAdapter = nfcManager.getDefaultAdapter();
boolean isAdapterEnabled = (nfcAdapter != null) && nfcAdapter.isEnabled();- crpalmer for his kernel build configs
- Michael Roland for his article on NFC support in SW3
- Cyanogenmod team (CM was used to build NFC binaries)
P.S. Some time later an in-depth article on how this stuff was done will be released. I'll post the link here.
No comments:
Post a Comment