Trying to read and write NFC tags phone to phone with the same AI2 app. I know nfc needs to be compiled to apk for use. Both phones both phones are nfc enabled androids with the same ai2 apk. It's throwing me an error that it can't do the nfc operation. Has anyone else come across this?
AIA: nfc.aia (3.2 KB)
APK:
Android and iPhone application packages (APK/IPA) are forbidden because we do not have a means to guarantee that they are not malicious. The apk was removed.
Developers can still search (but not post to) the old AI2 Google Forum. Use the Search for messages box at the top of the screen for information about all AI2 programming issues, discussions, solutions in the past six or so years.
@SteveJG thank you very much for your reply I've reviewed the previous threads on the Google forum. However, I'm still not sure with my issue. I'd like to share some links that we insightful regarding NFC and AI2 but didn't exactly answer my question in hope that they are helpful to others.
For NFC testing purposes I've found this NFC app to be useful. When I use this app to scan my AI2 NFC enabled app I get the following:
MIT provides an excellent NFC tutorial but it requires using an NFC sensor (not second phone).
If looking for RFID scanning with android, it's possible but it is suggested to try Flutter.dev or something else:
A phone can read a 13.56MHz RFID tag. However, the App Inventor NearField block can only read an NDEF text message from an NDEF formatted NFC (ISO14443A/B) tag. Unfortunately it cannot read the RFID serial number.
NFC is one of the most powerful capabilities on a mobile device in existence today. Very concerning there isn't more conversation about it on here. Hoping to get to the bottom of this. Please let me know the best way to go about reading and writing between phones using the NFC component in AI2. Thanks guys.
We're also having a difficult time with NFC and Appinventor. Can someone please spec out the appropriate tag to use. We're using a MIFARE classic and we are unable to get the NFC cup app to read the tags, also unable to write to it. Additionally, we wrote a few simple programs to also test with no luck. The MIFARE Class app and also NFC tools can both read the tag and write to it so what are we missing.
We teach a group of girls who would like to use this functionality in their app and we need to get it working asap.
Are the tags only Text tags ? Note this component supports the reading and writing of text tags only (if supported by the device).
You might post an example so everyone can see what you are trying to do. Be aware, the NFC tool does not support all tag formats. Are the apps compiled and loaded on both phones?
For some reason, the none of the tags work right from the manufacturer. After I write a test message using the app NFC TagWriter by NXP, the tags are formatted and work perfectly with AI2
So you need to reformat the tags first (mine was different than the user you suggested a MIFARE classic). Once you reformat the tag, you can write/read from the NFC tagwriter by NXP app.
Then the cup program and our test programs are working.
This information should be added to the tutorial. There's no hardware information other than buy tags that are compatible, and that information is insufficient especially based on others who are having the similar issues.