Blowing Smoke…

[Estimated Reading Time: 7 minutes] To alleviate the grind of polishing and sanitising my code (and, let’s be honest, just plain ‘fixing’ it in some cases) ready for release, I have re-kindled my participation on Stack Overflow. In a happy confluence yesterday a question came up which allowed me to exercise one of the libraries that I’m preparing to release: Smoketest.

Build Automation With Train

[Estimated Reading Time: 5 minutes] A comment from Kevin P brought a build automation tool to my attention this evening, called Train. Train is a JavaScript based build automation tool from a little company called RemObjects. It is written in Oxygene but the API provides specific support for Delphi. It’s an open source project and free (as in beer). So I decided to check it out.

Platform Ignorants

[Estimated Reading Time: 3 minutes] A while ago Marco Cantu posted about an issue with implementing ShowModal in FireMonkey, specifically with reference to the difficulties this entailed on iOS and Google Android platforms. Chris Rolliston recently picked this same topic up and highlighted some problems that still remain in the FireMonkey “solution”. Both Marco and Chris however have missed a key point. Neither Google nor Apple are stupid.

VCL Threading – Indeterminate Lifetimes

[Estimated Reading Time: 6 minutes] Sometimes when you launch a thread you don’t know when it will complete whatever processing it is tasked with. Sometimes you do. Sometimes it may never complete and will require that you expressly terminate it. Usually any given thread will have a lifecycle that is at least consistently one or the other, but sometimes you will come across an awkward thread which is not so straightforward. Sometimes you will be creating a thread on behalf of somebody else who is making these decisions.

Unit Aliases and Build Configurations

[Estimated Reading Time: 3 minutes] Over on stackoverflow, Ann Gossard had a question about using an $ifdef in the project (DPR) uses list to use one unit in preference over another, specifically in debug builds. In this situation, it immediately occurred to me that unit aliases might be creatively deployed. What follows is a slightly expanded version of the answer I posted to that question.

VCL Threading – Synchronization

[Estimated Reading Time: 6 minutes] Although I am using Oxygene a lot these days, Delphi remains my tool of choice for Win32 (and x64) development, together with the VCL. Hence this post. A long time ago, in a galaxy far far away, Delphi was a Windows only development tool. 16 was the number of the bits with which it was concerned, and 1 was the number of threads in the process (though it was not called a thread). It was a simpler time. Then the bits were doubled and the number of threads did multiply, but it was important still that some things happened only on the original thread, though for a time a blinded eye could be turned since – no matter the plurality of threads – with only one piece of silicon to share, only one thread could be running at any one time. Yet lo, TThread.Synchronize() was conceived.

Importing an Android Class For Use in Delphi

[Estimated Reading Time: 3 minutes] In a previous post I noted the absence of the BatteryManager class in the AndroidAPI.JNI units. This class contains some constants useful when reading battery information. I showed how to use a suitably massaged literal in place of these missing constants, but in response to observations from Paul and Brian decided to look at how to import the missing class itself.