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

AndroidAppmethodCode SnippetDelphiFiremonkeyIOSOSXWindows

Build Responsive Apps With Timers And Threads Using Delphi XE6 Firemonkey On Android And IOS

Delphi XE6 Firemonkey Asynchronous Apps Threads BackgroundMarco Cantu has a blog post up where he demonstrates various ways for building non-blocking or asynchronous apps using Delphi XE6 Firemonkey. While your app is doing work in the main thread of your application the user interface is blocked from responding to user input. Performing the operations in the background or asynchronously solves this problem. Marco shows how you can use a timer to kind of achieve background operations and leave your UI responsive to the user. Finally he shows how to use a thread (which is a better way of completing work in the background). We’ve covered threads on here before and especially the anonymous thread class which comes as an extra addon with Delphi Firemonkey. There are also some threaded dialogs you can use for when you are performing work. Some of the comments on the blog post talk about the Application.ProcessMessages; function which you can use within loops to keep your app responsive even while performing work. Generally it is considered bad to use Application.ProcessMessages; but I usually do it anyway. If you want to take advantage of multiple CPUs in your device you can do parallel processing with loops. These same ideas apply across Delphi XE5, XE6, AppMethod, Android, IOS, Windows, and OSX. Try them out and see which one works best for you.

Head over and check out the full blog post by Marco about performing operations in the background of your apps.


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