# NFC on Android?

**URL:** https://discourse.processing.org/t/nfc-on-android/19126
**Category:** Processing for Android
**Created:** [March 29, 2020, 2:23am UTC](https://discourse.processing.org/t/nfc-on-android/19126 "2020-03-29T02:23:05Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![TechMaster04](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/techmaster04/32/14929_2.png) [@TechMaster04](https://discourse.processing.org/u/TechMaster04)
#### Post date: [March 29, 2020, 2:23am UTC](https://discourse.processing.org/t/nfc-on-android/19126/1 "2020-03-29T02:23:05Z")

</div>

Hello

I had the idea of making a Monopoly money manager that uses NFC tags, kind of like contact less credit cards.

I did some research and found the Ketai library, which appears to no longer support NFC, after both reading online and trying for myself. Every search I do leads me to this incompatible library.

Is there any other library/command that can utilize the phone’s NFC to read/write to NFC tags? Or will I have to make it less cool and have a GUI?

Thanks in Advance

---

<div class="post-metadata">

### Author: ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)
#### Post date: [March 29, 2020, 9:21am UTC](https://discourse.processing.org/t/nfc-on-android/19126/2 "2020-03-29T09:21:47Z")

</div>

@TechMaster04 ===

I have done that with Android Studio using the nfcAdapter class from Android; it s rather easy but i have to get a look to the code in order to see how to transform it for P5. with this class you can read/write/record nfc.

more details here: [https://developer.android.com/guide/topics/connectivity/nfc/nfc](https://developer.android.com/guide/topics/connectivity/nfc/nfc)

---

<div class="post-metadata">

### Author: ![TechMaster04](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/techmaster04/32/14929_2.png) [@TechMaster04](https://discourse.processing.org/u/TechMaster04)
#### Post date: [March 29, 2020, 4:17pm UTC](https://discourse.processing.org/t/nfc-on-android/19126/3 "2020-03-29T16:17:30Z")

</div>

Ah I see. So my only option is to use Android Studio? Or are you suggesting I use P5,js?

---

<div class="post-metadata">

### Author: ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)
#### Post date: [March 29, 2020, 4:32pm UTC](https://discourse.processing.org/t/nfc-on-android/19126/4 "2020-03-29T16:32:48Z")

</div>

@TechMaster04 ===  
What i say is that i have done that with AS; it does not mean it s impossible with P5; as i have told: i have to see wether i can adapt my code to P5 and i am quite sure that it s possible: i ll give a look as soon as possible. I am not at all speaking about P5JS.

---

<div class="post-metadata">

### Author: ![TechMaster04](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/techmaster04/32/14929_2.png) [@TechMaster04](https://discourse.processing.org/u/TechMaster04)
#### Post date: [March 29, 2020, 6:01pm UTC](https://discourse.processing.org/t/nfc-on-android/19126/5 "2020-03-29T18:01:49Z")

</div>

Okay. Sorry I seem to have misunderstood you. Thank you so much. I am hopeful of this succeeding

---

<div class="post-metadata">

### Author: ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)
#### Post date: [April 3, 2020, 3:54pm UTC](https://discourse.processing.org/t/nfc-on-android/19126/6 "2020-04-03T15:54:13Z")

</div>

@TechMaster04 === weird result: i have tried to adapt my code to processing and except some details (which can be importants) i have done that; now if i test the code with P5 it does not read the tags (though the nfc is activated and running) but when i export to android and use exactly the same code inside AS it runs as expected and read the tags; as for now i cannot understand that…But i ll try because it’s absolutely abnormal.

---

<div class="post-metadata">

### Author: ![TechMaster04](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/techmaster04/32/14929_2.png) [@TechMaster04](https://discourse.processing.org/u/TechMaster04)
#### Post date: [April 3, 2020, 5:43pm UTC](https://discourse.processing.org/t/nfc-on-android/19126/7 "2020-04-03T17:43:14Z")

</div>

That is very weird. I have begun to clear up space on my SSD in the event that i will need to use Android Studio (I literally only have 500 mb left 😅).

I appreciate all the effort you’ve put in to this for me, and wish you the best of luck. If you need any help debugging, I can try to help 😃

---

<div class="post-metadata">

### Author: ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)
#### Post date: [April 4, 2020, 5:36pm UTC](https://discourse.processing.org/t/nfc-on-android/19126/8 "2020-04-04T17:36:50Z")

</div>

@TechMaster04 ===  
Ok; now it works and i can understand which was the problem though there is some kind of bug with P5; in my code i have to call the MainActivity.class, which is not recognized (because it’s a class, not. java) and P5 does not accept, in the ide it fires an error “class not recognized”; yesterday i was there and today i thought "let us see what happens, despite of the red “not recognized”… suspense: it compiles as with AS and everything is ok…And why AS does not fire this error? that is simple: i have imported the android folder from P5 && inside it there are the compiled class…and the main one… Easy??? @noel === if you are ok i can send the running code for your repo, tag ‘nfc read/write’, i have only to add that i have found solutions for ndef tags but not any for tech: is s solved with xml inside AS.

---

<div class="post-metadata">

### Author: ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)
#### Post date: [April 4, 2020, 5:54pm UTC](https://discourse.processing.org/t/nfc-on-android/19126/9 "2020-04-04T17:54:15Z")

</div>

@akenaton  
Yes, thanks, and please, feel free to modify anything you want. I will be grateful.

---

<div class="post-metadata">

### Author: ![TechMaster04](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/techmaster04/32/14929_2.png) [@TechMaster04](https://discourse.processing.org/u/TechMaster04)
#### Post date: [April 5, 2020, 12:24am UTC](https://discourse.processing.org/t/nfc-on-android/19126/10 "2020-04-05T00:24:33Z")

</div>

Quite the intricate issue indeed. Congratulations on debugging it!
