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


Implement A Dynamic Broadcast Receiver In Delphi XE6 & XE7 Firemonkey On Android

| Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOS

Delphi XE6 Firemonkey Dynamic Broadcast Receiver For Android | Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOSDeveloper Barış Atalay has released a demo with source that implements a dynamic broadcast receiver for Android in Delphi XE6 Firemonkey (and I assume it should upgrade to XE7 easily). On Android a Broadcast Receiver is a service that listens for a broadcast to execute an action within an app (usually via an Intent). This is accomplished by creating a custom classes.dex file with three Java classes that implements a BroadcastReceiver. Within the Delphi app an OnReceive event is defined and that is where you process the received Intent from the broadcast. In the case of the source code demo it sends a toast message when an Intent is received. The Android JNI code in this project is pretty complex and but since it is a demo with source I think you can just start building your own code on top of the existing foundation. It looks like it uses a RegisterDelphiNativeMethods which is similar to the function used in this Firemonkey JNI callback example. The blog post is in Turkish so you may want to use Google Chrome to translate it. This demo should also work with Appmethod without too much trouble.

Head over and read the full blog post about building your own dynamic broadcast receiver for Android with Delphi XE6 Firemonkey.

And download the demo source code for the Delphi XE6 Firemonkey broadcast receiver app here.

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

Related posts

AutoBlogAI: FireMonkey Client To Leverage LLMs And Generative AI For Blogging


Unleashing Creativity With Song Writer AI: A Deep Dive


How To Build Stable Diffusion Text To Image Prompts


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

Sign up for our Newsletter and
stay informed

Leave a Reply