During my recent product launch travels and during several of the Friday Developer Direct sessions, developers have asked me several common questions: 1) Is FireMonkey for iOS in XE4 the same as the FireMonkey iOS that was part of XE2, 2) Do we cross compile Delphi code to Objective-C code and then build the iOS app using XCode on the Mac and 3) Why do I need a Mac to be able to build an iOS app with XE4? There are simple answers to all of three of these questions: 1) No, 2) No, 3) Because. All kidding aside, let me give you more complete answers to explain that with XE4 we have moved Delphi for iOS way beyond what we did in XE2 for iOS. FireMonkey FM3 is the next generation platform for building multi-device, true native apps for iOS, Windows and Mac, using a single codebase.
Delphi XE4 for iOS application development is part of our third generation of development for FMX. FM3 contains 3 years of continuous development with refactorings, improvements, enhancements and new innovations. iOS programming with FireMonkey 3 takes developers way beyond what was available in FireMonkey 1 with multi-device (Windows, Mac and iOS) capabilities including:
- Multimedia - audio and video playing and capturing
- Layout Management - Layout, GridLayout, FlowLayout
- Anchors
- Touch and Gestures
- Actions
- Form Families (for desktop, iPhone and iPad form factors)
- Faster and more GPU utilization
- Native Bitmap pixel formats (raw data can still be accessed)
- Platform, Device and Sensor Services - and you can create your own custom services
- Device/Sensor components - Location, Motion, Orientation, Camera (front, back, flash), Web Browser
- Native and Custom Styling
- KeyboardType property
- Native Controls - message alerts, custom pickers, date picker, cut/copy/paste
- Notifications
- ListBox and ListView
- and more
Do we cross compile to Objective-C and compile for iOS? No, we have native code optimizing Delphi compilers for Win32, Win64, OSX, iOS_Intel_Simulator and iOS_ARM_Device (5 compilers integrated into the IDE and also available as command line compilers). Take a look at the following two bitmaps taken from a debug session in the XE4 IDE. You will see the a simple iOS app with a button and onClick event handler. The app is stopped at a breakpoint. The two CPU Viewers show Intel machine code (iOS Simulator target) and ARM machine code (iOS Device target) compiled by the Delphi compilers. (Note: click on each image to see a larger version of each bitmap)


Why do you need a Mac and Xcode to be able to build iOS Device applications? To build OSX and iOS apps we need to leverage the Apple header files, libraries and debugging information available only on a Mac. We also need to use a couple of the Apple command line tools that are part of Xcode to SandBox and CodeSign your application for deployment from our Windows IDE to your iOS device and to the Apple iOS app store. One XE4 IDE, one workflow, one designer is all you need (you don’t have to worry about multiple IDEs, project conversions, etc). Install the Platform Assistant (PAServer) on your Mac, connect your iOS device to the Mac and let the Delphi IDE do the magic. If you don’t have a Mac, you can always "rent" one in the cloud at, for example, MacInCloud (http://www.macincloud.com/) or buddy up with friend or neighbor that has a Mac. You can also pick up a used iMac or MacMini for under $300 (just make sure they are capable of running OSX Lion or Mountain Lion releases).
There’s lots more happening inside Embarcadero for future releases of FireMonkey and also to support Android and other devices. Have you ever built a location sensor based Browser app for an iOS device? Watch the very short video at http://www.youtube.com/embed/NOYhf1h83Zs. You can build this app using Delphi XE4 and FireMonkey 3 using three components (TSwitch, TLocationSensor and TWebBrowser) and two lines of code:
procedure TLocationForm.LocationSensor1LocationChanged(
Sender: TObject;
const OldLocation, NewLocation: TLocationCoord2D);
begin
{ Pass the Latitude and Longitude to Google Maps }
WebBrowser1.Navigate(
Format('https://maps.google.com/maps?q=%s,%s&output=embed',
[NewLocation.Latitude.ToString, NewLocation.Longitude.ToString]
)
);
end;
procedure TLocationForm.swLocationSensorActiveSwitch(Sender: TObject);
begin
{ activate or deactivate the location sensor }
LocationSensor1.Active := swLocationSensorActive.IsChecked;
end;
You can get started today with XE4 and FireMonkey 3! The free trial download is available at http://www.embarcadero.com/products/delphi/downloads
Share This | Email this page to a friend