0%

Learn to rapidly build and deploy cross-platform applications from a single codebase with practical, real-world solutions using the mature Delphi 10.4 programming environment

Key Features

  • Implement Delphi's modern features to build professional-grade Windows, web, mobile, and IoT applications and powerful servers
  • Become a Delphi code and project guru by learning best practices and techniques for cross-platform development
  • Deploy your complete end-to-end application suite anywhere

Book Description

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.

What you will learn

  • Discover the latest enhancements in the Delphi IDE
  • Overcome the barriers that hold you back from embracing cross-platform development
  • Become fluent with FireMonkey controls, styles, LiveBindings, and 3D objects
  • Build Delphi packages to extend RAD Server or modularize your applications
  • Use FireDAC to get quick and direct access to any data
  • Leverage IoT technologies such as Bluetooth and Beacons and learn how to put your app on a Raspberry Pi
  • Enable remote apps with backend servers on Windows and Linux through REST APIs
  • Develop modules for IIS and Apache web servers

Who this book is for

This book is for Delphi developers interested in expanding their skillset beyond Windows programming by creating professional-grade applications on multiple platforms, including Windows, Mac, iOS, Android, and back-office servers. You'll also find this book useful if you're a developer looking to upgrade your knowledge of Delphi to keep up with the latest changes and enhancements in this powerful toolset. Some Delphi programming experience is necessary to make the most out of this book.

Table of Contents

  1. Fearless Cross-Platform Development with Delphi
  2. Contributors
  3. About the author
  4. About the reviewer
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Share Your Thoughts
  6. Section 1: Programming Power
  7. Chapter 1: Recent IDE Enhancements
    1. Understanding the Delphi IDE
    2. Delphi 10 Seattle
    3. Delphi 10.1 Berlin
    4. Delphi 10.2 Tokyo
    5. Delphi 10.3 Rio
    6. Delphi 10.4 Sydney
    7. Summary
    8. Questions
    9. Further reading
  8. Chapter 2: Delphi Project Management
    1. Technical requirements
    2. Creating a console application
    3. Building a Windows VCL application
    4. Starting a multi-device application
    5. Working with dynamic libraries
    6. Understanding packages
    7. Dealing with Android services
    8. Customizing your favorite project types
    9. Using build configurations effectively
    10. Build events
    11. Working with related projects
    12. Managing source modifications
    13. Looking through your code history
    14. Integrating source repositories
    15. Using the command-line tools for build automation
    16. Summary
    17. Questions
    18. Further reading
  9. Chapter 3: A Modern-Day Language
    1. Technical requirements
    2. Remembering Delphi's Pascal roots
    3. Reviewing the syntax
    4. Growing a language
    5. Adding objects to Pascal
    6. Promising functionality with interfaces
    7. Handling unknown data types
    8. Supporting nested types
    9. Migrating to Unicode
    10. Applying strong type checking generically
    11. Adding anonymous methods for cleaner code
    12. Adding metadata to your classes with attributes
    13. Learning about the latest enhancements
    14. Simplifying variable declaration
    15. Controlling initialization and the finalization of records
    16. Summary
    17. Questions
    18. Further reading
  10. Section 2: Cross-Platform Power
  11. Chapter 4: Multiple Platforms, One Code Base
    1. Technical requirements
    2. Moving to FireMonkey from the VCL
    3. Starting a new Windows FireMonkey project
    4. Migrating an existing Windows VCL application to use FireMonkey
    5. Preparing other platforms
    6. Preparing a Mac for cross-platform development
    7. Running your first cross-platform application
    8. Preparing for iOS development and deployment
    9. Preparing your PC to deploy to an Android device
    10. Working with various screen sizes
    11. Exploring target views
    12. Writing code to support multiple platforms
    13. Summary
    14. Questions
    15. Further reading
  12. Chapter 5: Libraries, Packages, and Components
    1. Technical requirements
    2. Sharing code in libraries
    3. Things to keep in mind for the Windows platform
    4. Loading libraries dynamically versus statically
    5. Things to keep in mind for non-Windows platforms
    6. Putting code into packages
    7. Working with package filenames
    8. Turning a package into a component
    9. Creating our first component
    10. Adding in the code to a component
    11. Adding design-time properties to a component
    12. Adding cross-platform support to components
    13. Summary
    14. Questions
    15. Further reading
  13. Chapter 6: All About LiveBindings
    1. Technical requirements
    2. Using the LiveBindings designer to get started quickly
    3. Using layers to group LiveBindings elements
    4. Revealing embedded component properties
    5. Creating magic with the LiveBindings Wizard
    6. Pulling in fields from a database
    7. Adding more controls through the wizard
    8. Prototyping custom objects at design time
    9. Swapping out prototype data for your own custom data
    10. Applying custom formatting and parsing to your bound data
    11. Getting to the BindingsList
    12. Customizing the display
    13. Parsing edited data
    14. Coding your own LiveBindings methods
    15. Summary
    16. Questions
    17. Further reading
  14. Chapter 7: FireMonkey Styles
    1. Technical requirements
    2. Understanding and using FireMonkey styles
    3. Loading style sets
    4. Selecting between multiple StyleBooks
    5. Accessing substyle definitions
    6. Customizing FireMonkey styles with the Style Designer
    7. Creating a default style for a control type
    8. Creating a custom style for a specific control
    9. Styling your applications with ease
    10. Quickly setting a single, application-wide style
    11. Customizing styles per form
    12. Managing style resources with code
    13. Summary
    14. Questions
    15. Further reading
  15. Chapter 8: Exploring the World of 3D
    1. Technical requirements
    2. Getting started with 3D in Delphi
    3. Adding 2D controls to a 3D form
    4. Adding basic and extruded shapes
    5. Showing lines for the axes
    6. Extruded shapes
    7. User-defined shapes
    8. Adding color, lighting, and movement
    9. Adding a light source to colors and textures
    10. Coloring extruded objects
    11. Adding animation
    12. Animating color
    13. Importing 3D models
    14. Changing the camera
    15. Multiple cameras
    16. Satellite camera
    17. Testing on phones
    18. Let's write a game!
    19. Implementing hidden clickable areas
    20. Activating and deactivating an object
    21. Mixing 2D and 3D controls for best use of each
    22. Working with layered objects at design time
    23. Deciding on the end game
    24. Summary
    25. Questions
    26. Further reading
  16. Section 3: Mobile Power
  17. Chapter 9: Mobile Data Storage
    1. Technical requirements
    2. Comparing different approaches
    3. Learning about InterBase's editions
    4. Introducing SQLite
    5. Managing databases
    6. Using the InterBase Server Manager and IBConsole
    7. Trying out SQLite Studio
    8. Setting up access to tables and queries
    9. Utilizing FireDAC, Delphi's cross-platform Data Access Component
    10. Getting table and query records from InterBase
    11. Getting table and query records from SQLite
    12. Deploying your database
    13. Deploying IBLite and IBToGo
    14. Updating data on a mobile device
    15. Understanding touch-oriented interfaces
    16. Summary
    17. Questions
    18. Further reading
  18. Chapter 10: Cameras, the GPS, and More
    1. Technical requirements
    2. Setting up
    3. Establishing a base
    4. Getting permission
    5. Setting up permissions for Android apps
    6. Using sensitive services on iOS
    7. Capturing your neighborhood
    8. Saving an image to the database
    9. Loading previously taken images
    10. Expanding your use of the camera
    11. Marking your spot
    12. Getting permission for location services
    13. Saving coordinates in the database
    14. Showing the location in the list view
    15. Mapping your way
    16. Setting up a Google Maps API key for Android
    17. Setting up your Delphi project to use Google Maps
    18. Plotting park points
    19. Changing the map style
    20. Sharing your pictures
    21. Summary
    22. Questions
    23. Further reading
  19. Chapter 11: Extending Delphi with Bluetooth, IoT, and Raspberry Pi
    1. Technical requirements
    2. Starting with Bluetooth Classic
    3. Configuring Classic Bluetooth
    4. Discovering and pairing devices
    5. Publishing Bluetooth services
    6. Connecting and communicating
    7. Learning about low-energy Bluetooth
    8. Utilizing beacons
    9. Setting up a beacon server app
    10. Finding and reacting to beacon messages
    11. Fencing your application
    12. Doing more with the Internet of Things
    13. Discovering and managing your device
    14. Getting data from IoT devices
    15. Using a Raspberry Pi
    16. Using Android to run your apps on a Raspberry Pi
    17. Summary
    18. Questions
    19. Further reading
  20. Section 4: Server Power
  21. Chapter 12: Console-Based Server Apps and Services
    1. Technical requirements
    2. Starting with console apps on Windows and Linux
    3. Installing the Windows subsystem for Linux
    4. Running our first Linux app
    5. Adding a simple database lookup module
    6. Testing the data module with a console app
    7. Providing remote server connectivity for clients
    8. Testing with a console client
    9. Logging activity
    10. Sending logs in two directions
    11. Adding a custom logging mechanism
    12. Creating a Windows service
    13. Logging to the Windows Event Log
    14. Adopting a Linux daemon
    15. Exposing your server to the world
    16. Modifying our client app to use the new server
    17. Summary
    18. Questions
    19. Further reading
  22. Chapter 13: Web Modules for IIS and Apache
    1. Technical requirements
    2. Surveying website-building options in Delphi
    3. Understanding the Web Server Application wizard
    4. Getting comfortable with the underlying framework
    5. Templating your HTML
    6. Building an ISAPI web module for IIS on Windows
    7. Logging from an ISAPI web module
    8. Getting started with the Apache HTTP server
    9. Installing and starting Apache on Windows
    10. Installing and starting Apache on Linux
    11. Writing cross-platform Apache web modules
    12. Deploying an Apache web module on Windows
    13. Deploying an Apache web module on Linux
    14. Summary
    15. Questions
    16. Further reading
  23. Chapter 14: Using the RAD Server
    1. Technical requirements
    2. Establishing a use case for RAD Server
    3. Considering an application's multi-user needs
    4. Enabling push notifications for registered devices
    5. Justifying the cost
    6. Getting familiar with what's included
    7. Running RAD Server on a development environment
    8. Using the RAD Server Management Console
    9. Writing modules to extend your server
    10. Using the wizard to create our first resource package
    11. Implementing MyParks for RAD Server
    12. Building a REST server without code
    13. Testing RAD Server with the REST Debugger
    14. Inserting, updating, and deleting data
    15. Modifying MyParks for use with RAD Server
    16. Setting up RAD Server connection components
    17. Sending updates back to RAD Server
    18. Summary
    19. Questions
    20. Further reading
  24. Chapter 15: Deploying an Application Suite
    1. Technical requirements
    2. Configuring for a wide audience
    3. Getting settings in desktop applications
    4. Updating a web module with dynamic settings
    5. Updating a RAD Server package with dynamic settings
    6. Reviewing mobile data storage locations
    7. Securing data
    8. Securing your server's data transmission
    9. Controlling access to resources
    10. Adding application security for RAD Server clients
    11. Protecting your hardware and operating system
    12. Adding a graphical touch
    13. Iconifying desktop apps
    14. Iconifying mobile apps
    15. Setting splash screen options on iOS
    16. Creating splash screens for Android
    17. Establishing product identity
    18. Including Windows version information
    19. Identifying your Apple product
    20. Identifying your Android product
    21. Testing for deployment
    22. Using virtual machines
    23. Testing the wide range of mobile devices
    24. Distributing the final product
    25. Installing RAD Server modules to production
    26. Selecting deployment configuration
    27. Deploying macOS and iOS applications
    28. Deploying an Android app
    29. Summary
    30. Questions
    31. Further reading
  25. Assessments
    1. Chapter 1 – Recent IDE Enhancements
    2. Chapter 2 – Delphi Project Management
    3. Chapter 3 – A Modern-Day Language
    4. Chapter 4 – Multiple Platforms, One Code Base
    5. Chapter 5 – Libraries, Packages, and Components
    6. Chapter 6 – All about LiveBindings
    7. Chapter 7 – FireMonkey Styles
    8. Chapter 8 – Exploring the World of 3D
    9. Chapter 9 – Mobile Data Storage
    10. Chapter 10 – Cameras, the GPS, and More
    11. Chapter 11 – Extending Delphi with Bluetooth, IoT, and Raspberry Pi
    12. Chapter 12 – Console-Based Server Apps and Services
    13. Chapter 13 – Web Modules for IIS and Apache
    14. Chapter 14 – Using RAD Server
    15. Chapter 15 – Deploying an Application Suite
    16. Why subscribe?
  26. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts
54.221.43.155