Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodCode SnippetDelphiDemoFiremonkey

Access And Use The NFC (Near Field Communication) Hardware In Delphi XE7 Firemonkey On Android

Delphi XE7 Firemonkey Android NFC BridgeDevelopers Brian Long and Daniel Magin teamed up to enable NFC support on Android in Delphi XE7 Firemonkey. NFC stands for near field communication and it is a set of wireless technologies available on Android devices which only connects with other devices within 4cm. Brian Long has released a tutorial on how to get NFC support working in your own XE5, XE6, and XE7 projects (should work in AppMethod as well). First off it requires access to the NFC sensor and so you need to enable the NFC permission for your app in the Android manifest. There are also two different methods for accessing the NFC data which are the tag dispatch system and the foreground dispatch system. Both methods are covered in depth in the tutorial. The tag dispatch system mainly involves customizing the Android manifest and adding an XML file to your project. The foreground dispatch system is more difficult to achieve and involves overriding the Firemonkey Android NativeActivity. The code inherits from FMXNativeActivity and overrides the OnNewIntent event. The code for reading and responding to the NFC intents is placed in the new OnNewIntent event. The tutorial is really in depth so you’ll need to access it directly for all of the sample source code. There is also a blog post discussing the tutorial and it also contains links to the tutorial for each version of Delphi.

Head directly to the tutorial for implementing tag and foreground dispatch for NFC access in Delphi XE7 Firemonkey on Android.


Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts

FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes


Ryzen 9 5950x: One Billion Lines Of Delphi Code Compiled In ~5 Minutes On 16 Cores


DelphiCon 2020 FireMonkey Sessions Available Starting November 19


Powerful Commercial Gorilla3D Framework Upgraded For Delphi FireMonkey On Windows And Android

Sign up for our Newsletter and
stay informed

Leave a Reply