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


Easily Handle Intent Callbacks In FireMonkey With Delphi 10 Berlin On Android

Delphi 10 Berlin Android Callback Firemonkey Intent JavaBrian Long has a new blog post up which explains handling Android callbacks with Firemonkey in Delphi 10 Berlin. If you are doing Android programming, you are surely familiar with the callback system that handles either the events from an intent filter or passing of data between Activities. Obviously this is only for Android and not IOS, OSX, or Windows. In previous versions (Delphi XE5, XE6 and XE7), you had to deal with custom Java code, custom activity sub-classing and other boilerplate code. But with the new Delphi Berlin, the callbacks are picked up by the FireMonkey activity’s onNewIntent method and sent into the RTL cross-platform messaging system. You can write your own code to process the new intents. This intent messaging is done via an additional use of the Android-specific TMessageReceivedNotification message (these messages contain an instance of JIntent then wraps and Android intent). It is IFMXApplicationService, that provides cross-platform access to event notifications so that you do not need to use a different, platform-specific event system on each platform that your application targets. When IFMXApplicationService receives an event notification from the operating system, it generates a message object (TMessage or one of its descendants) to provide the event data. The message object contains read-only information about the event that occurred. Thus, with Delphi Berlin it is now simpler to handle the intents received from hardware (camera, bar-code scanner, or any other device), no boilerplate code, easier debugging.

Head over and read the full blog post from Brian about Android callbacks for FireMonkey with Delphi 10 Berlin.


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