Wednesday 17 April 2013

Initial thoughts on Delphi XE4 - iOS development

So the main thrust of my blog entries in the past few years have been about how I've wanted to make the leap from Delphi 6 to the latest version, currently Delphi XE3. As you may have read so far, we're now there and it has brought us so many benefits that I have promised I'll post about later.

In the meantime, because of purchasing XE3, I've also been allowed to take part in the beta testing of Delphi XE4, which many are referring to as Delphi for iOS.

I must mention that I have specifically given permission to discuss this by Embarcadero, and that any thing I raise now is still under pre-release and subject to change. This also isn't a critique of what is there or what is missing, more an overview to help answer any questions you may have about what is coming.

A point that confused me before taking part in the Beta was "is this going to be just an iOS development tool, or is the next version of Delphi"? The answer to that is clearly the latter. This product will be launched as RAD Studio XE4/Delphi XE4/C++ Builder XE4, and will be a complete version of your favourite development tool. It still allows for Win32, Win64, Mac and Metropolis projects as XE3 does, with the new addition of iOS Mobile projects, using Firemonkey.

When you start a new project, you are presented with an on-screen representation of the iPhone canvas.



iOS project in Delphi XE4

On this screenshot as an example, you can see a standard TButton, TListBox and TToolbar, all of which are styled with Firemonkey to appear as native iPhone controls. The IDE allows you to rotate this view, as well as select different form types so you can develop for iPhone 5 and iPad.

This appears on the XCode iOS Simulator as:



Project on the XCode iOS Simulator

My demo application has a TClientDataSet which is used to store local settings, and uses DataSnap client components to communicate over the internet to a DataSnap server running in my organisation. All of this technology has been available in Delphi for some time but it is crucial that this is working for enterprise iOS apps, and it is working great.

Unlike Delphi XE2 which used the Free Pascal compiler to generate the iOS code, XE4 handles everything natively. You still, of course, need an intel-based Mac running Lion or Mountain Lion, and like with Mac OS development, Embarcadero provide the Platform Assistant (PAServer) which runs on the Mac. Your Delphi project will communicate with the PAServer on the Mac (as set in Project Options, see screenshot below), which in turn communicates with XCode via the command line to deploy your project in the iOS Simulator or onto your iOS Device.


If you have been using any recent version of Delphi or RAD Studio then the IDE is as familiar as ever, which makes this such a great opportunity for us long-term Delphi users to start writing iOS apps. A great job has been made in getting "styles" together for the iOS controls, so that your TListbox can be styled in a variety of different native and expected ways. The TButton, too, has dozens of style options that comes with recognisable images so that your app can appear as native as you need it to be. Of course, if you want to eschew the standard styling and go your own way, Firemonkey gives you the freedom to do that.

As each pre-release version has been issued, so have more and more demos, and the documentation is improving, so there is plenty of good sample code to show you how to use the camera, the Share features, accelerometer, compass, etc.

There is plenty more to talk about this exciting new version of Delphi, but we are still in the pre-release phase and I'm sure there's more to come.

4 comments:

Unknown said...

So, if I understand this correctly, the Delphi iOS controls will only be native in appearance and use the firemonkey framework; but firemonkey will not actually link to the native XCode control libraries. Correct?

RemObjects is taking a more native approach by using the native Xcode APIs and built-in controls. So any sample code for using xcode with objective-c will work the same as with Oxygene.

Anonymous said...

Correct Brian,

If Apple decides to change the looks and feels of there system delphi-ios applications will look like black sheep. IMHO it is a quick and dirty solution of Embarcadero which could have great impact, but voila

Unknown said...

Yes Brian, as I understand from what I've seen, the controls are being drawn by Firemonkey so everything *is* native but not necessarily using the in-built Xcode controls. That said, the RTL is calling the iOS interfaces for using features such as the camera, sharing controls, GPS, etc, so there is an element of using the device natively.

I've been interested to read a great deal of negative comments, whilst I remain relatively impressed with what I've seen & done. I don't have to learn a new language or even leave an interface I've come to know instinctively, in order to produce pretty powerful iOS apps.

One thing I would say - I'm not sure it's ready to be released as soon as some are hinting at.

Anonymous said...

So, no more free-pascal code? Only the good Delphi Language? NICE!
We will have component hint and component focus(next key) on design time?
And how about imagelist and dataware components?
And how about these buttons a lot? They are now only one?
Corner button, Flat Button, Xbutton, TButton, this is unnecessary.

Sorry for so many questions, but i'm really exited!

IMO, Dataware is very important to get attention of developer express team. I think they don't like firemonkey(YET), or they are waiting for it became a solid tecnology. Firemonkey is too new and beta yet. Dataware is too important to make upgrade of old projects, like the very big DX project, or my personal project. No matter how Embaradero say X or Y thing is better, but how many tools and ways to go we will have, batter will be.
Also, i don't like the simple components on older(XE2) Firemonkey, beause there are a lot important things missing. In part beause i'm still using DX for 5 or 6 years, and i daily use rich grids, textedits, Editlookups(too important, more than a grid), menus, etc.


So, by now, i think Firemonkey is too poor compared to other similar tecnologies that we have today in the world.
I really expect to see a very rich firemonkey components set on this 4 version, or i will still wait for DX on Firemonkey.

I just can't understand how difficult for Embarcadero is to make things better and simple for us.