Upcoming event

Be-Delphi Delphi Developer Day

Be-Delphi is organizing their first (of many) Delphi Developer Day on November 17th in Edegem near Antwerp. That day will be completely dedicated to Delphi and Prism.

At Be-Delphi, Devia will be holding a talk about the new LiveBindings in Delphi XE2, so be sure to grab a hold of me and say hello !

Delphi XE5 First Impressions

written by Stefaan Lesage on 02/12/2013

Well, it's been quiet on this blog for a while now. Delphi XE3 and XE4 have seen the daylight and not even a single post has appeared here about those. With the launch of Delphi XE5 and it's promise of developing cross-platform applications for Android made me quite curious. I wanted to check it out as soon as possible, but we were in the middle of a big project for a client (a Warehouse Management Project written in Delhi), and the last thing we wanted to do was change our development environment from XE2 to the new shiny XE5. The last thing we wanted was Murphy sneaking in so close to the actual delivery of the WMS System.

Meanwhile things have calmed down a little, and I finally had the time to install Delphi XE5 in a new Virtual Machine on my Mac. Of course, the first thing you want to try out is build a simple dumb one button application and compile it for iOS and Android. And that is exactly what I did.

Setting it all up

Back when Delphi XE2 launched, I was quite interested in how you could developer FireMonkey applications for iOS. Back then getting everything up and running actually took a while. Not only did XCode need Free Pascal back in the days, but the whole configuration was too much of a hassle. I received so many questions on how to do the actual setup that I even made a complete video tutorial / screencast about it.

Well, 2 years later ... things changed quite a lot ... Getting set up was a breeze. No need for Free Pascal anymore, no hassle with FireMonkey files on OS X and XCode. Just a matter of installing and running the PAServer on the Mac side and connecting to it from within the Delphi XE5 interface.

On the Android side of things, I don't even remember having to do anything special. I just installed Delphi XE5 with the default settings and made sure the Android development tools got installed as well. But in case you don't use the default Android Development tools supplied with Delphi XE5 you will find all information you need in this DocWiki article.

In my case, the only big issue I had was getting the USB Drivers working correctly for my Samsung Galaxy S4 and the Acer Liquid E2 test device I have at home. I could not seem to get the S4 working correctly but had no issues using the Liquid E2. After changing some settings on the S4 even that device worked perfectly.

I think about half an hour later I had Delphi XE5 installed, configured and had deployed a simple one button application to both an iOS device and 2 Android devices. It was about time to start toying with some other things.

imageHello World! My first app on Android created with Delphi XE5

The new REST Client Library

Delphi XE5 comes with a new REST Client library which is supposed to make developing REST clients a lot easier. At home I have a Netatmo Weather Station and I know it has a REST Api ... the perfect setup to see if this REST Client library is worth checking out. I quickly registered my test application to get a ClientID and ClientSecret token and about 10 minutes later I was up and running and getting my first set of data out of the Netatmo Weather station.

image
The new REST Client library in Delphi XE5 is a breeze to work with.

All of this was simply a matter of adding a TRESTClient component, a few TRESTRequest components and corresponding TRESTResponse components. From here I only had to supply the Base URL for the API, and set up the requests, add a button to a form and call .Execute on the TRESTRequest. Worked as a charm ... and all this also works at design time! Yes ... in my Delphi XE5 IDE I could execute the request and see the JSON Response in the TRESResponse component. And you have to know ... I didn't really do all that much REST stuff with delphi before this.

I think about 2 hours later I had incorporated some TRESTDataSetAdapter components, a few TClientDataSet, TDataSource and TDBGrid components and I had the JSON Response displayed as records in a grid. This all with I think about 5 lines of code, now ... how neat is that!

image
Pulling the data out of the Netatmo REST API into TClientDataSet components. The power of Delphi XE5 and the new REST Client Library!

From my personal experience the new REST Client Library was awesome. The only real problems I had was probably my own lack of knowledge on how to use those components. I might be doing a series on further tutorials on this showing you how I got my data out of the Netatmo devices if there is enough interest for that.

Other changes

IDE wise a few things have changed too. The Target Platforms node in the Project Manager now has 2 sub nodes. One is used for the target platform / device. Here you will find your emulators / simulators / connected devices. Beneath that you will find a node for Configuration which can be used for different built configurations like a Debug build an internal build, …

In the Delphi IDE you can now select a Design Device from a list of presets. This allows you to have an idea about how your UI will look on an actual device. Quite handy, especially for Android where you have many different screen sizes and resolutions to work with.

One last change I noticed was in the IDE Insight. Back in Delphi XE2 the IDE Insight used to pop-up a dialog listing your options. Now the IDE Insight dialog has been replaced by a search box in the toolbar of your IDE. It works in the same way, but the first few times I pressed CTRL+. I had the impression that the IDE Insight wasn't working because I didn't see the dialog box appear. I'm not sure yet if I really like this new setup, but I guess I'll get used to it pretty soon.

Overall Impression

Well … in short .. I'm really looking forward to playing with the iOS and Android side of things. I know I was quite impressed with the iOS things when Delphi XE2 launched too, but gave up quite quickly because it was too hard to configure, setup and use. This time around I think a huge effort has been made to improve on this. I'm still not sure if developing an application in Delphi for iOS and Android will give you the same User Experience as you would have using the default tools for the platform. I guess I will have to try that out for myself and keep you updated on the progress

Comments

  • 1

    yes, using DELPHI XE5 for Android is very simple and short development cycles for cross platform apps :-)

    written by FranzB on 05/12/2013
  • 2

    Hi Franz,

    Well … I just took it out for a quick spin, but I’m planning to take some time and try a few things out in the next weeks. I’m hoping to toy a little more with the REST Client Library, was quite impressed with that.

    Regards,


    Stefaan

    written by Stefaan Lesage on 05/12/2013
  • 3

    Looking forward to try it myself.  Would love to hear more details as you work with it more.

    written by Gordon on 05/12/2013
  • Commenting is not available in this weblog entry.

    Archive