Show: Delphi C++
Display Preferences

What's New in Delphi and C++Builder XE5

From RAD Studio
Jump to: navigation, search

Go Up to What's New


Contents

What's New in XE5 Update 2

★ C++Builder application development for the iOS device

  • BCCIOSARM.EXE, the C++ Cross Compiler for iOS Device (our new compiler):
    • BCCIOSARM supports development for the iOS Device target platform and does not support the iOS Simulator.
    • BCCIOSARM is one of our Clang-based C++ Compilers (our latest generation of C++ compilers).
    • BCCIOSARM does not support certain types that are not accepted on the mobile platform (in particular, WideString, ShortString, AnsiString, and AnsiChar).
      Note that AnsiString and AnsiChar do still exist in C++Builder, but they are scaled back in the mobile environment; some methods might not be available on mobile.
    • BCCIOSARM uses automatic reference counting (ARC) for C++ iOS in order to be compatible with Delphi iOS.
      All the ARC management is handled inside the BCCIOSARM compiler, so you should not need to do anything different in order to work in the C++ iOS ARC environment. Your code can still use pointer syntax for a Delphi class instance. The BCCIOSARM compiler treats these pointers as special pointers, and thus neither declarations nor usage have to change.
  • iOS Mobile Application Development:
  • C++ Strong Aliases:
    • Earlier versions of Delphi mapped built-in types such as NativeInt, NativeUInt, and WordBool to C++ built-in types. Newer versions of Delphi handle these types as strong aliases, such as TAlphaColor or TImageIndex. In order to be compatible with the change, C++ will also create strong aliases using a class wrapper.
      For example, if you need to handle a NativeInt, you need to specify the type (NativeInt).
      • For example:
        NativeInt i = 10; // error
        NativeInt i = NativeInt(10); // OK
  • C++ Unrestricted Unions:
    • Unions can now contain objects that have a non-trivial constructor. See Union Declarations.
  • New: You can now use HPPEMIT Delphi compiler directives for linking and generating C++ namespace declarations.
    • {$HPPEMIT NOUSINGNAMESPACE} suppresses the generation of the "using namespace <unit-name>;".
    • {$HPPEMIT LINKUNIT} replaces #pragma link for the iOS device target platform.
      For more information, see HPPEMIT.
  • QueryInterface for IUnknown works a bit differently for BCCIOSARM than for the other C++ compilers. You need to override QueryInterface as described in System.IUnknown.QueryInterface.
  • C++11 features are partly supported for iOS:
    • Core C++11 features typically work with BCCIOSARM. This includes variadic templates, static assertions, multi-declarator auto, Lambda expressions, and others.
    • Standard (Run-time) C++11 features are typically not supported by BCCIOSARM. This includes initialization of class objects by rvalues, Atomic operations, and others.
    C++11 features are documented in C++11 Features Supported by RAD Studio Clang-based C++ Compilers.

Delphi

  • Delphi iOS: ABI Change for Default Alignment (Rebuild Required for Delphi iOS Apps):
The default alignment of field instructions for Delphi has changed from 8-byte (Quad Word) to 4-byte (Double Word) boundaries to match iOS requirements. This change affects Delphi iOS apps that are to be used with C++.
You need to recompile and rebuild your existing Delphi iOS projects (from XE5 Update 1 or earlier).
Be aware that when you recompile, an error might occur if the project contains DCUs (or object files or libraries) for which the source is not available on the search path.
Beyond this, most users might never need to deal with this change.
However, if you require a particular record size, you can reset the Record field alignment option on the Project > Options > Delphi Compiler > Compiling page for expedience.
For example, you can set the alignment to Double Word (8 bytes, equivalent to {$A8} or {$A+}).
Keep in mind that you might subsequently need to recompile your Delphi iOS project with the new 4-byte boundaries, and if this happens, you should set the Record field alignment to Word (equivalent to {$A4}) on the Compiling page.

FireMonkey

Using Mobile Preview allows you to:
  • See your mobile app in a mobile-like form on your development system.
  • Run your mobile app without having to configure and connect a mobile device.
  • Verify and debug your program logic.

Samples

The application samples now have folders for Delphi and C++ (CPP) under the FireMonkey and FireMonkey.Mobile categories. The help pages for the affected samples have been updated with the correct location information. For example, see FMX.ImageSpin Sample and FMX.Mobile.ScrollableForm Sample (C++).

For more information about the samples, see Samples Descriptions.

Release Notes for XE5 Update 2

See Release Notes for XE5 Update 2.

FireMonkey Changes for XE5

Android Mobile Application Development

  • In your application code, differences are minimal between Android and iOS, so you can essentially use one code base for both iOS and Android, with a few exceptions, such as the following:
    • Modal dialog boxes, which are commonly used in desktop applications, require user input before returning to the parent dialog or window. On Android, dialog boxes are popups, and modal dialog boxes are not well supported.

Gestures on Android

  • RAD Studio supports the same gestures on the Android platform and on the iOS platform: Zoom, Rotate, Pan, Two Finger Tap, Double Tap, and Long Tap.
    (The PressAndTap gesture is supported only on Windows.)
  • For more information, see Gestures in FireMonkey.

Audio Recording File Formats for iOS and Android

If you are recording from microphone with TCaptureDeviceManager.Current.DefaultAudioCaptureDevice (as is done with the AudioRecPlay mobile code snippet), you need to save files using the following file extensions:

  • .CAF on iOS
  • .3GP on Android

Video Playback File Formats for Android

  • On the Android platform, .3GP files are typically audio-only, as illustrated in the AudioRecPlay mobile code snippet.
    However, the .3GP format can also support video playback. If you switch to use video codec in FMX.Media.Android.pas, you can play video as with other files (such as mp4). However, this change also means that you cannot record audio and then play it back as you would expect with the AudioRecSample.

Refactoring in FireMonkey XE5

Some refactoring has occurred in the FireMonkey libraries.

For example, TBitmap has moved from FMX.Types (in XE4) to FMX.Graphics (in XE5). Thus, you will now need to add FMX.Graphics to the uses list for any of your existing applications that use TBitmap. Similar changes are required for any other controls that were moved to another unit.

For more information, see FireMonkey Refactoring in XE5.

Using Multi-Resolution Bitmaps

FireMonkey multi-resolution bitmaps enable your images and icons in FireMonkey applications to appear correctly in different resolutions (Windows, iOS, Mac OS X, and Android). A multi-resolution bitmap is a collection of bitmap items providing the same image but having different scales.

For more information, see Using Multi-Resolution Bitmaps.

WebBrowser for Android

Pickers for Android

FireMonkey Styles Changes: Each Style Now Contains All Resolutions

The format of FireMonkey styles has changed in order to offer multiresolution support and to simplify style objects and improve performance.

All default styles and premium styles have been updated. This means that old XE4 styles do not work correctly in XE5, and the new XE5 styles do not work in XE4. You need to reload your FireMonkey styles and make a few code changes as described here.

In XE5, each FireMonkey style includes all resolutions. For example:

  • An iOS style includes Retina (2x) and non-Retina (1x) graphics.
  • An Android style includes graphics in 1x, 1.5x, 2x and 3x resolutions.

Each form must use one TStyleBook now, and the old TStyleBook.HiResStyleBook property has been deleted.

In code, you should use only:

 procedure TForm1.Create(Sender: TObject);
  begin
  ...
  TStyleManager.SetStyleFromFile('Jet.style');
 end;

For information about FireMonkey styles, see:

Enhancements of TListView

Set SearchVisible to True to show a search box in your list view

The TListView control has seen some improvements:

  • Changing the EditMode property at run time shows an animation as the list view goes into edit mode or goes back to the display mode.
  • In minus edit mode (EditMode is True and ItemAppearance.ItemEditAppearance is of Delete type), when you click a list item, the minus icon on the left-hand side rotates and a Delete button slides in from the right-hand side.
  • In display mode (EditMode is False), if CanSwipeDelete is True, swiping left or right over a list item makes a Delete button slide in from the right-hand side.
  • If SearchVisible is True, your list view shows a search box that can filter the content of the list.
  • If SearchAlwaysOnTop is True, the list view search box is always visible at the top of the list. If SearchAlwaysOnTop is False, the list view search box behaves as a list item, and as you scroll down the list the search box gets hidden.
  • New events:

IDE Changes for XE5

The Mobile target platforms (iOS and Android) have Target and/or Configuration nodes

Platform Targets and Configurations

The Target Platforms node in the Project Manager now provides the following two child folders under each target platform:

  • Target lists the available devices and simulators/emulators running on the target platform.
  • Configuration lists the build configurations that are specific to the target platform.

Depending on the current project, the Project Manager can contain none, one, or both of the Target and Configuration folders. For example, a console application does not contain either the Target or the Configuration child nodes under Target Platforms.

The target platforms that were available in previous releases, such as 32-bit Windows or iOS Device, are still major nodes in Target Platforms.

The platform configurations (known in past releases as build types) previously available for Mac OS X (Normal, Application Store) and the iOS Device (Debug, Ad hoc, and Application Store) are now contained in the Configuration node nested under the target platform (Mac OS X or iOS Device).

The iPhone, iPad, and iPhone 5 simulators for the iOS Simulator are now contained in the Target folder under the target platform (iOS Simulator).

Android Target Platform Supported

The Android target platform is now represented in the Target Platforms node of the Project Manager.

When you create a FireMonkey Mobile Application, you can now select the Android target platforms in addition to iOS Device and iOS Simulator.

The Android target platform provides the following platform configurations:

  • Debug (for development cycles)
  • Application Store (for submitting your app to an Android application store)

The Target node lists Android devices connected to your development system, and configured Android emulators.

You can add Android to your custom run-time packages, and build them for the Android platform, so that your components can be used on Android as well.

For a list of supported Android devices, see Android Devices Supported for Application Development.

Design Devices Affect the Look and Feel

Design devices are preset forms that give you an idea of the final look of your form on a certain device or form factor.

If you set the design device that is your eventual target platform, the FireMonkey Mobile Designer loads the correct style for the selected platform.
For example, here are examples of applications using the design device settings of Google Nexus 4 and iPhone 5, respectively:

XE5AndroidLook.png
Android Device

XE5iOSLook.png
iOS Device

For more information, see Device Manager.

Changes to IDE Insight for XE5

The IDE Insight dialog box has been replaced by a search box in the upper-right corner of the IDE:

XE5IDEInsight.png
  • As you type a search string in the search box, a pop-up window displays any matching items. The pop-up window shows as many matching items as fit on your screen.
  • To invoke or open an item in the pop-up window, you can either click the target item, or navigate to the item using the Up and Down arrow keys and press Enter.
  • To focus the IDE Insight search box, you can use either Ctrl+. (period) or F6.

Multiselection on the Deployment Manager

XE5DeploymentManagerMultiSelection.png

The Deployment Manager now allows selecting more than one file. You can select several files and delete them from the deployment list or change their output path (Remote Path) at one time.

Tools Options Changes for XE5

Project Options Changes for XE5

Your project options provide new fields and pages so that you can prepare your new Android applications for deployment:

  • On the new Uses Permissions page you can choose the permissions that your application is to require. Android automatically asks users to grant your application the required permissions upon installation.
  • On the Application page you can configure your application icons for the Android platform.
  • On the Version Info page you can define settings of your application for the Android platform, such as its package name or version code.
  • On the Provisioning page you can create or load a keystore file with signing certificates to sign your Android application packages.

RAD Studio uses your project options for Android to generate an "AndroidManifest.xml" file from a template. "AndroidManifest.xml" is a file that all Android applications must have. You can edit the template to customize the content of the file that RAD Studio generates.

In XE5 Update 2 RAD Studio includes a new compiler: BCCIOSARM.EXE, the C++ Cross Compiler for iOS Device. Use the C++ Compiler Project Options to configure this compiler within the IDE.

Delphi Compiler Changes for XE5

New Delphi Android Compiler: The new Delphi compiler for Android (DCCAARM.EXE) is integrated into the XE5 product: DCCAARM.EXE, the Delphi Cross Compiler for Android.
DCCAARM enables you to compile Delphi applications for either an Android emulator or an Android device.
Like the other Delphi mobile compilers, DCCAARM supports certain language differences, which are described in Migrating Delphi Code to Mobile from Desktop.

Debugger Changes for XE5

  • The new Embarcadero Android Debugger enables you to debug Android applications that run either on a connected Android device or on an Android emulator.
  • Evaluation of properties is now supported on the iOS Device as well as the Android device/emulator and the iOS Simulator. Support is limited for evaluation of properties on the iOS device or the Android device and emulator.
    Previously, evaluation of properties was only supported on the iOS Simulator.

Delphi Run-Time Library (RTL) Changes

System.Types (RTL)

TPointF Changes

  • Added class operators for scaling (for example, "MyVec := SomeVec * 5" or "MyVec := 5 * SomeVec"), and deprecated the Scale function.
  • Inlined the Offset function for better performance, deprecated the SetLocation, Subtract, and Add functions, which are simply different cases of Offset.
  • Added the Length, Rotate, Reflect, MidPoint, AngleCosine, Distance, CrossProduct, and DotProduct functions.
  • Added alternative data type access field to work with TPointF as an array of 2 values.

TVector Changes

  • Removed some unnecessary private functions.
  • Added the Offset function similar to that of TPointF; removed the Scale function.
  • Added the Rotate, CrossProduct, MidVector, and AngleCosine functions.
  • Added class overloads for scaling similar to TPointF.

TMatrix Changes

  • Added class operators for matrix-matrix, point-matrix, and vector-matrix multiplication.
  • Added the Determinant, Adjoint, and Inverse class functions.
  • Added the CreateRotation, CreateScaling, and CreateTranslation constructors.
  • Added the TMatrix.Identity constant.

TPoint3D Changes

  • In addition to XYZ, this data type now has alternative V: TPoint3DType option, which treats TPoint3D as an array of three elements.
  • Added new constructor that receives TPointF and Z coordinate.
  • Added class operator for scaling, removed the Scale function. It works both ways: "P := P * 5" or "P := 5 * P" or "P := P / 2".
  • Added negative class operator while removing the "Negative" class function.
  • Added the Rotate, Reflect, MidPoint, and AngleCosine functions.

TVector3D Changes

  • The Normalize and GetNormalize functions were merged into one function, Normalize, which returns a normalized 3D vector while preserving the W coordinate.
  • Removed implicit and explicit conversion from TVector3D to TPoint3D, due to ambiguity in treating the W component in such operations.
  • The global Point3D function that receives TVector3D as a parameter has optional ATransform parameter, which, when set to True, divides the XYZ coordinates by W.
  • Added the TVector3D.ToPoint3D function, which returns TPoint3D from TVector3D and works similarly to the global Point3D function (see above).
  • Removed some internal redundant functions.
  • Moved PointProject and CalcPlaneNormal to FMX.Types.
  • Removed the Scale function; added class operators similar to those for TPoint3D.
  • Removed the AddScale and AddVector3D functions.
  • Added the Rotate, MidVector, and AngleCosine functions.

TMatrix3D Changes

  • Added class operator for TPoint3D/TMatrix3D multiplication (the W component, missing in TPoint3D, is assumed to be 1).
  • Added the Create, CreateScaling, and CreateTranslation constructors, the CreateRotationX, CreateRotationY, and CreateRotationZ high-performance variants, and the CreateRotation, CreateRotationYawPitchRoll, and CreateRotationHeadingPitchBank low-performance composite variants.
  • Added the CreateLookAtRH, CreateLookAtLH, CreateLookAtDirRH, CreateLookAtDirLH, CreateOrthoLH, CreateOrthoRH, CreateOrthoOffCenterLH, CreateOrthoOffCenterRH, CreatePerspectiveFovLH, and CreatePerspectiveFovLH view/projection matrix constructors. The last two can work both with horizontal and vertical field of view.
  • Removed the TransposeMatrix3D and ScaleMatrix3D methods in favor of the TMatrix3D.Transpose and TMatrix3D.Scale equivalents.
  • Added the TMatrix3D.Identity constant.

TQuaternion3D Changes

  • The type of ImagPart was changed from TVector3D to TPoint3D, to describe correctly quaternion with four components XYZW (instead of 5, where W was duplicated).
  • Added constructors for different types of quaternion, including creation of quaternion from matrix.
  • Added class operators for conversion from quaternion to matrix and quaternion-quaternion multiplication.
  • Added the Length and Normalize functions.
  • In addition to the traditional approach, quaternion can now be accessed as an array of 4 values.
  • Added the TQuaternion3D.Identity constant.

Database Changes for XE5

FireDAC Introduced in XE5

The new FireDAC data access layer, which supports the features needed to build real-world high-load applications, has been added to RAD Studio.

New REST Client Library Added

The new REST Client Library is supported on all platforms.

Connectivity Supported in XE5

RAD Studio supports the following database connectivity in the XE5 release:

  • dbExpress and FireDAC connect to InterBase and Sqlite databases on Android apps.
  • InterBase Express (IBX) connects to InterBase databases on Android apps.
  • DataSnap clients on Android connect to servers through tcp\ip, http, and https.
  • You can connect to the Amazon and Azure clouds on Android.

WebSnap and InternetExpress Removed from Product

WebSnap and InternetExpress, two older tools for Web application development, have been finally deprecated and removed from RAD Studio: As an alternative, use either of these:

Documentation Changes for XE5

See Also

Personal tools
In other languages