NearField (NFC) sensor component does not work reliably

I made some tests using the NFC sensor in the simplest way possible. Seems to me that is not reliable, reads only some tags of some types, some others open something as a system screen and it does not behave in the same way reading the same card. Tested on Android 13. I think the component needs some sort of engineering and rewriting. Tested using a Xiaomi POCO M3 5G Plus Android 13 and a old LG K8 2017 running Android Oreo 8.1.0

Don't know much about them, My guess is that you are testing using contactless cards or an apartment/ office tag. Now if your using an assortment of tags that are in use (hotel keys etc) you may find they are more secure than you think. Maybe the tag realises your trying to open it as a host rather than a user and takes you to a setup page. Have a look at point 4 of this website and it may answer some questions:

Further more this website proves some tags don't want to be/cannot read:

Well, I am a RFID and NFC technology "expert", at list in NXP, Infineon and ST they say I am an expert, and I delivered embedded solutions to big electricity, gas and water companies and producers of smart energy meters. So, to test the app I have a lot of different tags, self-adhesive labels and cards made by those industries or other their affiliates as LabID in Italy, G&D in Germany and others. I have SW and apps to read, write, erase and format NFC cards using NDEF records. So, the problem may arise in the phone itself, in some Android SW layer or in the implementation of the NFC reader/writer in AI2. Because using NXP/ST and other apps to manage NFC devices I am quite sure the problem is not on the phone and Android implementation side.

I think the documentation of the NFC block should report what type of tags is able to read and decode and the TagRead event should return also the UUID of the NFC, not only the message.

1 Like

This sounds like an opportunity for a well informed and hungry extension writer.

May be I will design in future, actually I am too tight with a couple of deliveries and last but not least I have to learn to write an extension... actually a misterious activity for me.

I saw that Kodular has a standard "extended" NearField component that reads also the UUID, it should been obvious since the beginning that it is needed.

Learning java to write extensions for a limited environment like AppInventor is nonsense. Many libraries cannot be used in extensions, and you can forget about AAR libraries with resources. When learning java, it's better to switch to, for example, android studio or other environment, there are more examples and fragments on the internet for apps written in java than for AppInventor. AppInventor for learning, simple apps that don't require extensive SDKs. For professional apps only java or kotlin. AppInventor is not a professional environment for people who sell their apps. Looking for solutions, extensions, waiting for patches, messing with AppInventor offline, etc... will take you more time than making an app in java.

1 Like

Java is not a problem but I do not agree with you. In many cases I developed professional apps using AI2 and/or AI2Offline in a fraction of time compared with Android Studio or Xamarin and they look nice as the others. Until you do not pretend to perform heavy computation tasks directly in AI2 the performance is quite good also. Many times delivery an app using AI2 is matter of hours or days, if tooks more is just because I have to learn something more not always related to AI2 but the problem to solve.

Professional is when you can react quickly to errors in the code. Here you have to wait months for someone to fix a bug in the code or make an extension that will do what you want. Because you don't have direct access to the code and you're stuck with other programmers. Now you have a problem with NFC, in Java you wouldn't have this problem ;).

To be honest there are also in Java... we will try in C/C++ to bypass everything

Today is not more possible developing everything by ouselves, we have to use some frameworks and if they big also if they are open source it is difficult to correct every error. At the moment I am not able to write an extension but surely I will learn ASAP. This is the price to don not know everything about AI2 but should be the same in Java/Android Studio because I do not know everything also about it.