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

AndroidAppmethodCode SnippetDelphiFiremonkeyIOSOSXWindows

Synchronize Or Queue UI Updates In Tasks With Delphi XE7 Firemonkey On Android And IOS

Delphi XE7 Firemonkey Synchronize And Queue TasksDeveloper Malcolm Groves from Embarcadero has a blog post up with some code showing how to update your app UI from Tasks in Delphi XE7 Firemonkey. Basically Tasks use threads to get things done and you can no update the UI from a thread without causing problems. The solution for this is to use either TThread.Synchronize or TThread.Queue. What these two functions do is run the function that you pass to them in the main thread. The Synchronize function runs it in the main thread now blocking it and the Queue function with run the function at some time in the future and will not block the main thread. The blog post also has an embedded video which is a thirty minute plus tutorial on using Tasks, Futures, and parallel programming in your apps. The goal with using all of these threads, async anonymous functions, tasks, and futures is to keep your app responsive so that the user isn’t waiting needlessly. This information applies to apps for Android, IOS, OSX, and Windows. It should also compile under Appmethod.

Head over and check out the full blog post about synchronizing tasks on the main UI thread and then watch the video for in-depth parallel programming info.

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

Related posts
AndroidC++BuilderCode SnippetDelphiDemoFiremonkeyIOSOSXShowcaseWindows

Powerful Cross Platform Email App Sample In Delphi 10.4.1 FireMonkey For Android And IOS

AndroidC++BuilderDelphiFiremonkeyIOSOSXWindows

Significant Update Available For Delphi FireMonkey 10.4.1 On Android, IOS, OSX, Windows, And Linux

C++BuilderDelphiIDEWindows

Professional SVG Icon Image List For Delphi 10.4 FireMonkey On Windows

AndroidC++BuilderDelphiFiremonkeyIOSLiveBindingsOSXWindows

Top Tips And Tricks To Speed Up Development With Delphi 10.4 FireMonkey On Android and IOS

Sign up for our Newsletter and
stay informed

Leave a Reply