Idle Musings of a Delphi JunkieThis is the blog of David Clegg, CDN developer and confessed Delphi Junkie2013-09-12T21:14:57ZWordPresshttp://blogs.embarcadero.com/dclegg/feed/atomDavid Clegghttp://blogs.codegear.com/dclegg/http://blogs.embarcadero.com/dclegg/?p=1602013-09-12T21:14:57Z2013-09-12T21:14:57ZI have spotted what I think may be the first Delphi for Android app to make it into the Google Play store. It’s an app developed by Brian Hamilton, which displays data from weather stations, and is a port of his existing iOS version (if you can call a single source, multi-platform app a port :-))

]]>8David Clegghttp://blogs.codegear.com/dclegg/http://blogs.embarcadero.com/dclegg/?p=1562013-09-02T20:58:48Z2013-09-02T20:58:48ZAs many of you may be aware, Jeremy North of JED Software has created an excellent Windows client to interact with the QualityCentral issue and feature tracking system used by Embarcadero. While he no longer hosts QC Plus on his site, he has kindly given me permission to host it on CodeCentral, and you can now download it from there.

It is important to note that QC Plus is being offered on an "as is" basis, with no warranties whatsoever. If you have any issues with the software, please do not contact Jeremy about it, as he is no longer supporting it. Of course, if you have any technical issues with QualityCentral, feel free to contact me.

]]>8David Clegghttp://blogs.codegear.com/dclegg/http://blogs.embarcadero.com/dclegg/?p=1542013-07-30T02:38:51Z2013-07-30T02:38:51ZYou may recall a few weeks ago that I blogged about upcoming changes to the DataSnap REST service used by EDN Mobile. Well, today I deployed these changes to production. So if you are an EDN Mobile user on version 1.1.4 or prior, I strongly suggest that you upgrade to the latest version.

And if you’re not an EDN Mobile user, what are you waiting for? Download it today!

]]>2David Clegghttp://blogs.codegear.com/dclegg/http://blogs.embarcadero.com/dclegg/?p=1522013-07-12T02:32:54Z2013-07-12T02:32:54ZVictory Fernandes (Twitter user @victoryjorge) has a great blog post demonstrating how easy it is to use the TMSCloudPack set of components to add Twitter integration into your Delphi for iOS applications. Nice work, Victory (and TMS, for providing such a simple to use API)!

As a Twitter junkie myself (feel free to follow me; my handle is @delphijunkie), this is something I may need to explore a bit more. Likewise, some of the other components in the TMS Cloud Pack look very useful, as I find myself embracing more and more cloud services.

]]>2David Clegghttp://blogs.codegear.com/dclegg/http://blogs.embarcadero.com/dclegg/?p=1472013-06-14T03:04:29Z2013-06-14T03:00:57ZI have been porting many of my DataSnap REST services from using dbExpress for its database access, to take advantage of the FireDAC data access framework. As a side-effect of this, I’ve had to make a change to the EDN Mobile application to handle a slight difference in datatype in some of the datasets it remotes to clients. In particular, the My Member Services and My duplicate accounts functionality may no longer work as intended with EDN Mobile versions 1.1.4 and prior once I upgrade the REST server.

I intend to upgrade the REST service that EDN Mobile consumes one month from today, so you should have plenty of time to upgrade to the latest version of EDN Mobile (currently 1.1.5). The new version should consume the existing REST service with no issues.

This upgrade also fixes a bug with the way auto login authentication details were stored, so if you are encountering issues in this area, this upgrade will be beneficial to you.

]]>3David Clegghttp://blogs.codegear.com/dclegg/http://blogs.embarcadero.com/dclegg/?p=1272013-05-01T23:16:35Z2013-04-30T23:32:28ZReading Anders Ohlsson’s latest blog post about using iOS APIs we don’t wrap reminded me of another couple of helper classes that I created, and which ship with the RAD Studio XE4 samples.

The first of these is the TAnonymousThread<T> generic class (in <samples installation directory>Delphi\RTL\CrossPlatform Utils\AnonThread.pas), and is designed to make it easy to create and consume anonymous threads for any activities that will return some kind of result (e.g. fetching data from a remote service). The public API for it is as follows :-

As you can see, the interface is pretty straightforward. It takes a series of procedure and function pointers to allow you to specify a function to be run in the thread, a callback procedure which will be run in the main thread so you can process the result, and a callback procedure which will run in the main thread if an exception occurs during thread processing. By default it will not start the thread suspended, and will free the thread on termination (for platforms that don’t have ARC implementations).

The second class is the TAsyncProgress<T> generic class (in <samples installation directory>Delphi\RTL\CrossPlatform Utils\Xplat.Utils.pas). Like the TAnonymousThread<T> class, it is designed to run a method returning a result in a separate thread, but has the added functionality of showing notification of a long running process. The public API for this class is as follows:-

As you can see, it has a similar interface to TAnonymousThread<T>, and accepts callback methods to handle a threaded function, and methods running in the main thread to process the result, or any exception that may occur during thread processing.

If you look at the implementation of TAsyncProgress<T> in Xplat.Utils.pas, you’ll see that it leverages the FMX.Platform.TPlatformServices class to register and consume an IPleaseWaitService interface. This interface has the following signature:-

I have created an implementation of this interface for iOS in iOS.Services.pas, and for OSX in Mac.Services.pas. The iOS implementation uses the technique that Anders blogged about to show the network activity indicator in the iOS status bar, but it also uses the UIActivityIndicatorView class to show a spinning progress indicator in the centre of your application view. Similarly the OSX implementation uses the NSProgressIndicatorclass to show a spinning progress indicator in the center of your main OSX application view.

To register an implementation for a given platform, simply add the relevant *.Services.pas file to your project.

In addition to leveraging the IPleaseWaitService interface via the TAsyncProgress<T> class, you can also interact with this service directly using helper methods in XPlat.Utils.pas, by utilizing the following:-

//Returns an instance of the IPleaseWaitService registered for the current platform
function PleaseWaitService: IPleaseWaitService;
//Runs the specified procedure (unthreaded), using the IPleaseWaitService interface to
//indicate execution progress.
procedure ProgressProc(AProc: TProc);
//Wraps a call to IPleaseWaitService.StartWait, if the service has been registered
procedure StartWait;
//Wraps a call to IPleaseWaitService.StopWait, if the service has been registered
procedure StopWait;

There are sample applications for iOS showing how to consume the TAnonymousThread<T> and TAsyncProgress<T> classes located in <samples base>Delphi\RTL\CrossPlatform Utils\AsyncProgress/AnonymousThread.dproj and<samples base>Delphi\RTL\CrossPlatform Utils\AsyncProgress/AsyncProgress.dproj respectively.

]]>4David Clegghttp://blogs.codegear.com/dclegg/http://blogs.embarcadero.com/dclegg/?p=1232013-04-23T10:44:02Z2013-04-23T10:34:40ZI thought I’d celebrate the release of RAD Studio XE4 by climbing back on the article writing horse. My first article is about persisting settings in iOS applications written in Delphi, and can be found on EDN.

As always, all feedback is greatfully received. And I’ll see if I can conjure up a few more over the coming weeks (no promises though :-)).

]]>3David Clegghttp://blogs.codegear.com/dclegg/http://blogs.embarcadero.com/dclegg/?p=1192012-12-05T00:38:16Z2012-12-05T00:25:24ZA couple of weeks ago, I implemented a new EDN feature which may have gone unnoticed by many of you. When you log into Member Services, you will now see a new ‘My eligible field tests’ option in the navigation bar to the left.

My eligible field tests navigation element

When you click on this, it will show you a list of any field tests you may be eligible to participate in, due to having a registration for a qualifying Embarcadero product.

Eligible field tests

As of today, this means that all current Delphi XE3, C++ Builder XE3, and RAD Studio XE3 users have access to the Quintessence field test, which will allow you to test and provide feedback on the latest iteration of iOS support in Delphi.

When you find an eligible field test that you think you may want to participate in, click the ‘Sign up’ link to the right of the table, and you will be taken through the field test sign up process. Once you’ve signed up for a field test, clicking this link again should (in a roundabout way) take you to the overview page for that field test. I intend to enhance this further so that any eligible field tests you’ve already registered for will handle this in a more seamless method (think of it as replacing the roundabout with a freeway :-)).

A new version of EDN Mobile has been launched, and along with it comes a few new features that moves it from being simply a clone of the http://members.embarcadero.com website, to instead starting to harness some of the features found in Android smartphones.

I used this opportunity to write an EDN article about it, for the benefit of the one or two community members who don’t follow my blog :-). Feel free to take a read to find out more about the newest features of EDN Mobile, and please take it for a test run and let me know what you think.

]]>2David Clegghttp://blogs.codegear.com/dclegg/http://blogs.embarcadero.com/dclegg/?p=1032012-05-03T01:39:31Z2012-05-03T01:39:31ZThanks to a totally unsolicited email from EDN community member Whiler, I am pleased to announce that EDN Mobile now supports the French locale.

I now invite other community members to provide localizations in any of the supported languages. As of Android 4.0.3, this list is available here. The localization process is pretty simple, and involves downloading these XML files, and replacing the English text values with the localized version (leaving the name attribute untouched). Once you’re done, you can email me the updated file, and I’ll incorporate it into a subsequent release of EDN Mobile.

Also, if you email me your intent to perform a localization, or add a comment here, I can keep everyone updated in the comments so we don’t have multiple people working on the same localization.