Hi all, i'm working on an NFC app and i need to know if a device has NFC capabilities and if it's enabled or not.
The current nfc library doesn't have this function so i decided to write this piece of code and share it with you.
To do this i reused some pieces of useful code to get the BA.context from here:
https://www.b4x.com/android/forum/threads/problem-with-additionaljar-javaobject-and-context.48958/
all credits to his author.
The uploaded code is commented and self-explanatory, you need at least api 10 to compile this and NFC permission in manifest.
It uses javaobject and phone library
With this code you can:
-check if a device is NFC capable
-check if the NFC hardware is enabled or disabled
-Open the NFC settings screen
Bye
DavideV
The current nfc library doesn't have this function so i decided to write this piece of code and share it with you.
To do this i reused some pieces of useful code to get the BA.context from here:
https://www.b4x.com/android/forum/threads/problem-with-additionaljar-javaobject-and-context.48958/
all credits to his author.
The uploaded code is commented and self-explanatory, you need at least api 10 to compile this and NFC permission in manifest.
It uses javaobject and phone library
With this code you can:
-check if a device is NFC capable
-check if the NFC hardware is enabled or disabled
-Open the NFC settings screen
Bye
DavideV
Attachments
Last edited: