Monday, 16 October 2017

Project corruption bug

Long ago there was an issue with the RAD Studio IDE (Delphi and C++Builder both). It meant that when changing certain project options or switching build configurations, the (XML format) project file would get saved with an extra errant (empty) XML element in it, causing subsequent compilations to baulk, complaining about: ProjectExtensions appears multiple time in project. If you build from the command line the error looks like: [MSBuild Error] MSB4079 The <ProjectExtensions> element occurs more than once.

The extra line in the file, were you to open it in a text editor and take a look, will be rather like this:

    <ProjectExtensions />

If you peruse some of the entries in Embarcadero’s Quality Central portal, such as this, this or even this, then you’ll see that Embarcadero made some changes in XE6 that improved matters (done against Quality Central bug 109016, no longer accessible since QC went offline some while back, but in this list of XE6 fixes), but clearly has not dismissed the problem entirely. Various customers do continue to hit it, albeit not very reproducibly.

Saturday, 14 October 2017

Delphi build/install/launch Android app from the command-line

Quite some while back I answered a question on Stack Overflow, which explained how to build a Delphi project from the command line and also how to deploy it. The context of the question was Andriod development

In the case of an Android application deploying it has absolutely nothing to do with installing the resultant .apk file onto your Android device, despite what your personal interpretation of the word may be. Oh no, most definitely not.

Instead, deployment is about packaging up all your various files - your compiled Android library (a .so file), all the images, splash screens, icons, custom files, databases, application manifest file and so forth – all into an .apk file. In other words as far as the Delphi IDE is concerned, deploying a Delphi project means going from a .so native ARM library to an installable .apk file.

Clearly when you press F9 or Ctrl+Shift+F9 to run your application the IDE works out how to install your .apk on the currently connected and selected device, but that is subsequent to the IDE’s notion of the deployment step.

So, installation notwithstanding, that SO answer shows how to make/build and deploy a Delphi project, such as an Android project, from a RAD Studio command prompt:

EKON 21

I’m delighted to say that later this month I’ll be over in Cologne speaking at EKON 21, which runs from 23rd to 25th October, 2017 and is being held in Cologne in Germany.  I’m doing three Delphi-related talks on some of my favourite subjects: creative debugging, Android API usage and IDE tips/techniques.

Unfortunately, though, being as all three talks are in the same day, Tuesday 24th October, I’m not sure I’ll get to see much of the other great talks on offer, which is a shame for me.

It’s great to be heading back to EKON – I haven’t been over to Germany for a conference since long ago in 2004 at the joint BorCon Europe 2004 / EKON 8 conference in Frankfurt.

Tuesday, 22 November 2016

Debug logging in FireMonkey – CodeRage XI Lightning Talks

During CodeRage XI I had a couple of Lightning Talks broadcast on a subject I’ve been intending to write up for quite a long time, but haven’t quite managed to achieve: how to emit debug log messages on the various FireMonkey platforms.

I made a 10 minute video for Delphi and one for C++ looking at all the target platforms, Win32/Win64, OS X/macOS, Android and iOS, showing the logging options and then looking at how to view log output.

Unfortunately I got a bit caught up in some work and didn’t publicise this ahead of the conference, so I think not many people were aware of them.

Friday, 9 September 2016

Android callbacks wrapped by FireMonkey

A couple of years ago (exactly!) I posted on this blog about an article I’d written on accessing NFC tags from Delphi Android applications. At the time this was quite an involved exercise, requiring custom Java code to be compiled and linked in to the application in order to respond to the pertinent Android callback, Activity.onNewIntent. Indeed, Delphi versions XE5, XE6 and XE7 all have slightly differing capabilities, with each new release making certain Android operations rather easier.

While catching up on what’s new in recent releases of Delphi I realised a change had been snuck into Delphi 10 Seattle that makes the whole NFC exercise much more straightforward now in Delphi.

Thursday, 1 September 2016

Speaking at the SDN Event

All the preparations are nigh on complete and this evening I shall be on a short aeroplane ride to Holland (or The Netherlands, if you prefer) to present a couple of Delphi talks at one of the SDN’s big SDN Events – full agenda here. I’ll be in good company as also speaking on the Delphi track will be TMS Software’s Bruno Fierens and also Bob Swart.

I’ve spoken at User Groups regularly but this is the first opportunity for me to talk to Delphi developers from further afield at a conference since April 2015 when I was at the ADUG Symposium, speaking in Canberra and Melbourne.

SDN events are always friendly gatherings and I’ve spoken at a few of them over the years: 1997, 1999, 2002, 2005, 2006 and 2012.

This time around I will be speaking on two of my favourite subjects: creative debugging techniques and accessing the Android OS API. Naturally I’ll be using the latest and greates version of Delphi as a vehicle for the talks, and I’ll be trying to squeeze in as many technical tips, tricks and techniques as I can into the 2 hour-long sessions.

For those attending the event tomorrow (2nd September, 2016) I’ll see you there!

Thursday, 23 June 2016

Live Templates (née Code Templates)

Over the years since Delphi 3 various people have written about aspects of Code Templates and Live Templates, but not particularly recently. I find Code Templates fabulously helpful and Live Templates add some real power into the mix.

About six or seven months ago (November 2015) I did a User Group talk on Live Templates and it seemed to provoke some reasonable interest. Since then I’ve been trying to find a suitable time window to sit down and write it all up. At last I have had a couple of days to gather my thoughts and get it all down on (metaphorical) paper.

For the benefit of those who haven’t considered creating Live Templates to help their productivity, or who have forgotten about the feature over time, please feel free to peruse Code Templates and Live Templates over on my web site.