Book Image

Fearless Cross-Platform Development with Delphi

By : David Cornelius
Book Image

Fearless Cross-Platform Development with Delphi

By: David Cornelius

Overview of this book

Delphi is a strongly typed, event-driven programming language with a rich ecosystem of frameworks and support tools. It comes with an extensive set of web and database libraries for rapid application development on desktop, mobile, and internet-enabled devices. This book will help you keep up with the latest IDE features and provide a sound foundation of project management and recent language enhancements to take your productivity to the next level. You’ll discover how simple it is to support popular mobile device features such as sensors, cameras, and GPS. The book will help you feel comfortable working with FireMonkey and styles and incorporating 3D user interfaces in new ways. As you advance, you’ll be able to build cross-platform solutions that not only look native but also take advantage of a wide array of device capabilities. You’ll also learn how to use embedded databases, such as SQLite and InterBase ToGo, synchronizing them with your own custom backend servers or modules using the powerful RAD Server engine. The book concludes by sharing tips for testing and deploying your end-to-end application suite for a smooth user experience. By the end of this book, you’ll be able to deliver modern enterprise applications using Delphi confidently.
Table of Contents (22 chapters)
1
Section 1: Programming Power
5
Section 2: Cross-Platform Power
11
Section 3: Mobile Power
15
Section 4: Server Power

Delphi 10.4 Sydney

After 2 years of updates to the previous version of Delphi, 10.4 Sydney was finally released in May 2020. One important change for this version is that it now requires a 64-bit version of Windows 10. Running the IDE is no longer supported on any prior version of Windows (what this means is that while it might be technically possible to install Delphi 10.4 on an earlier 64-bit version of Windows, it is not recommended and you may encounter problems in some aspects of working with it—you have been warned!). For most developers, this won't require a new computer but it is a big step for the IDE—even though at its core, it is still a 32-bit application!

You can still target 32-bit operating systems of Windows, but 32-bit macOS and iOS devices have been removed (although when using the iOS simulator, it's still 32-bit). Android 64-bit and 32-bit devices are supported for the Android API versions 6 through 10.

Delphi 10.4 is now only supported on 64-bit Windows 10:

Here's a list of target devices supported by Delphi 10.4:

One significantly improved feature is Code Insight. This is a set of useful typing helpers in the code editor and includes Code Completion, Code Parameter Hints, Code Hints, Block Completion, Help Insight, Class Completion, Error Insight, and Code Browsing. Often, parts of it are disabled because it can slow down coding, especially on large projects or slow machines as it precompiles and looks up identifiers in related units to help you type faster and catch errors on the fly.

In Delphi 10.4, these tools have been off-loaded from bogging down the editor to a separate server process that communicates with the IDE asynchronously using a Language Server Protocol (LSP). The Code Insight settings are now defined per language in the Options windows. What's more is that Code Insight now also works while debugging!

Reporting bugs must be done manually now. If you get an IDE exception, you can save the error report to a file, then go to https://quality.embarcadero.com and submit a problem discussion, along with the saved error report.

If you have ever gotten tired waiting for the Options screen to open, you will be happy to know that it opens faster now. There's a constructor for each page, which is now delayed until the page is shown.

Scrolling in GetIt Package Manager has been greatly improved with a single tweak. The list position now stays on the item just installed, so you can immediately go to the next one in the list instead of scrolling back down from the top as in previous versions. This was a great annoyance when installing a long list of styles.

There are three new convenience features in Delphi 10.4's code editor status bar:

  • Syntax Highlighter: If you work in multiple languages, the syntax checker for the current language is displayed and you can click it and switch to a different language. This supports more than just Delphi and C++. The IDE might become your default editor to work on SQL, PHP, INI, CSS, HTML, and other supporting files, centralizing your editing tasks:
Figure 1.7 – Override the default syntax checker selected for the current file

Figure 1.7 – Override the default syntax checker selected for the current file

  • File Encoding: Your current file's encoding is now displayed and can be changed. This could be quite handy when working with XML files—another aid to keep all your files in the IDE:
Figure 1.8 – Switch file encoding quickly

Figure 1.8 – Switch file encoding quickly

  • Font size: There's now a trackbar in the status bar with increase/decrease buttons to allow you to adjust the font size. Clicking Ctrl + Num+ and Ctrl + Num- still do the same thing:
Figure 1.9 – Visually change the font size in the editor

Figure 1.9 – Visually change the font size in the editor

Another notable change is that the clipboard history (added in Delphi 10 Seattle as part of the Castalia integration) has been removed, partially for security reasons and partially because if you copy very large amounts of data to the clipboard, it could potentially crash the IDE.

The Welcome page, which was drastically changed in Delphi XE8 and was cluttered with advertising, events, and more, now shows three columns of links:

  • Creating new projects, opening existing ones, and links to Platforms and Extensions Manager and GetIt Package Manager
  • Favorite and recent project listings
  • YouTube Video Channel

Here is what it looks like:

Figure 1.10 – The default Welcome screen in Delphi 10.4

Figure 1.10 – The default Welcome screen in Delphi 10.4

If this is still too much, you can modify the web page and take out what you feel is unnecessary. The Welcome page is simply a local web page in your Delphi installation's Welcomepage folder. Choose the subfolder for your language (for example, en for English) and make sure you run your editor as Administrator if Delphi is installed under the standard Program Files (x86) protected folder structure. Then, after making a backup of the files there, simply modify the HTML, JavaScript, and CSS to your heart's content!

There are several other minor improvements in speed and control-painting and placement, in addition to several bugs fixed. The IDE now uses native VCL controls, which resolves a few display issues.