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

Writing code to support multiple platforms

While the bulk of your code will be the same regardless of the platform upon which it's running, there will be some cases where you want to do things differently or provide different options if the application is running on a specific device. These unique application characteristics cannot always be implemented by simply customizing properties on a view but must be specifically handled by the code you write. And sometimes that code will only run on devices with very particular hardware architectures. To handle these cases, use conditional compilation.

In previous chapters, you've seen specially formatted comments that tell Delphi to link in resources (for example, {$R *.fmx}) or to create a console app (for example, {$APPTYPE CONSOLE}). This same type of syntax is used to include or exclude specific lines of code based on defined constants. These are not code identifiers, which are defined in a const section, but compilation identifiers...