NFC in Android from Delphi / Objective Pascal

One great thing about developing with Embarcadero’s RAD Studio, Delphi, C++ Builder and AppMethod is the component development model. Developing with components allows you to write code once that works across all platforms as the components take care of the platform specific API mappings. e.g. Talking to the camera, accelerometer, compass etc.

There are however times when a component doesn’t exist (yet). This is normally when something is platform specific as it doesn’t make sense to have a component that is platform specific when you can still call the API’s of that platform. e.g. prior to the announcements from Apple on the iPhone 6, NFC was on Android but not iOS. 

So what do you need to do when you don’t have a component ready to go? – Well it depends on what you want to call. With regards to accessing NFC, then Brian Long and Danny Magin, both Embarcadero MVP’s, have recently blogged about working through importing the Java libraries required, setting up the intents to collect the message from NFC, setting your application so Android knows it can deal with messages from NFC and then using them. Pretty cool 🙂

If your interested further in calling platform API’s then check out the replays from the Skills Sprints for accessing Android and iOS API’s directly.

2 thoughts on “NFC in Android from Delphi / Objective Pascal”

  1. I am having difficulty finding some examples of programming a USB NFC reader on a desktop. I currently use Delphi 10.2 and there are plenty of examples using an android phone but I need to use a desktop computer. Have you come accross any examples of this in your travels?

    1. Not sure – can you program the NFC reader to provide text output? I used to have something many years ago that tracked the text input speed (watching for a lead and termination character that the scanner added. The other option is to use a cheap mobile phone and app tethering to pass the data back to the desktop application.

Leave a Reply

Your email address will not be published.