You are previewing Delphi Cookbook.
O'Reilly logo
Delphi Cookbook

Book Description

50 hands-on recipes to master the power of Delphi for cross-platform and mobile development on Windows, Mac OS X, Android, and iOS

In Detail

With this book, you will gain valuable and practical knowledge of the latest functionalities of Delphi. Starting with the foundations, you will work on your VCL application, customize the TDBGrid, and configure your runtime class using RTTI. Going forward, you will build on this foundation and deploy FireMonkey to go cross-platform or even call FireMonkey from a VCL project, and you will fully understand how you can include Delphi on your server. Finally, you will use App Tethering, call Android and iOS SDK classes, and even use the Android TextToSpeech engine to add sounds to your phone! With this learning resource at your side, you will acquire all that a RAD Studio developer needs to know about Delphi in one complete, informative guide.

What You Will Learn

  • Create visually stunning applications using FireMonkey
  • Effectively use LiveBindings with the right OOP approach
  • Create server-side programs to serve RESTful web services and provide data to your mobile apps
  • Develop mobile apps using well-defined GUI design patterns for a great user experience
  • Build efficient mobile apps that read data from a remote server
  • Call the platform-native API on Android and iOS even for an unpublished API
  • Use extended RTTI to better manage the software customization for your customer
  • Leverage the most popular design patterns for a better design without wasting too much time debugging
  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. Delphi Cookbook
      1. Table of Contents
      2. Delphi Cookbook
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Delphi Basics
        1. Introduction
        2. Changing your application's look and feel with VCL styles and no code
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more...
        3. Changing the style of your VCL application at runtime
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        4. Customizing TDBGrid
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        5. Using the owner's draw combos and listboxes
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        6. Creating a stack of embedded forms
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        7. Manipulating JSON
          1. Getting ready
          2. How to do it…
          3. There's more...
        8. Manipulating and transforming XML documents
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        9. I/O in the twenty-first century – knowing streams
          1. Getting ready
          2. How to do it…
          3. There's more...
        10. Putting your VCL application in the tray
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        11. Creating a Windows service
          1. Getting ready
          2. How to do it…
          3. There's more...
            1. Using the TService.LogMessage method
        12. Associating a file extension with your application on Windows
          1. Getting ready
          2. How to do it…
          3. There's more...
      9. 2. Become a Delphi Language Ninja
        1. Introduction
        2. Fun with anonymous methods – using higher-order functions
          1. Getting ready
          2. How to do it...
          3. There's more...
        3. Writing enumerable types
          1. Getting ready
          2. How to do it...
          3. There's more…
          4. See also
        4. RTTI to the rescue – configuring your class at runtime
          1. Getting ready
          2. How to do it...
          3. There's more…
          4. See also
        5. Duck typing using RTTI
          1. Getting started
          2. How to do it...
          3. There's more…
        6. Creating helpers for your classes
          1. Getting ready
          2. How to do it...
          3. There's more...
          4. See also
        7. Checking strings with regular expressions
          1. Getting started
          2. How to do it...
          3. There's more...
      10. 3. Going Cross Platform with FireMonkey
        1. Introduction
        2. Giving a new appearance to the standard FireMonkey controls using styles
          1. Getting ready
          2. How to do it…
          3. How it works...
          4. There's more…
        3. Creating a styled TListBox
          1. Getting started
          2. How to do it…
          3. How it works...
          4. There's more…
        4. Impressing your clients with animations
          1. How to do it…
          2. How it works...
          3. There's more…
        5. Using master/details with LiveBindings
          1. Getting started
          2. How to do it…
          3. How it works...
          4. There's more…
        6. Showing complex vector shapes using paths
          1. Getting started
          2. How to do it…
          3. How it works...
          4. There's more...
        7. Using FireMonkey in a VCL application
          1. Getting started
          2. How to do it...
          3. How it works…
          4. There's more…
      11. 4. The Thousand Faces of Multithreading
        1. Introduction
        2. Synchronizing shared resources with TMonitor
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Talking with the main thread using a thread-safe queue
          1. Getting ready
          2. How to do it...
          3. There's more
        4. Synchronizing multiple threads using TEvent
          1. Getting ready
          2. How to do it...
          3. There's more…
        5. Displaying a measure on a 2D graph like an oscilloscope
          1. Getting ready
          2. How to do it...
          3. There's more…
      12. 5. Putting Delphi on the Server
        1. Introduction
        2. Web client JavaScript application with WebBroker on the server
          1. Getting ready
          2. How to do it...
            1. Retrieving the people list
            2. Creating or updating a person
            3. Deleting a person
            4. Running the application
          3. There's more…
        3. Converting a console service application to a Windows service
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Serializing a dataset to JSON and back
          1. Getting ready
          2. How to do it...
          3. There's more...
        5. Serializing objects to JSON and back using RTTI
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        6. Sending a POST HTTP request encoding parameters
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        7. Implementing a RESTful interface using WebBroker
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        8. Controlling remote applications using UDP
          1. UDP
          2. Getting ready
          3. How to do it...
          4. How it works...
          5. There's more...
        9. Using App Tethering to create a companion app
          1. Getting ready
          2. How to do it...
          3. There's more...
        10. Creating DataSnap Apache modules
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      13. 6. Riding the Mobile Revolution with FireMonkey
        1. Introduction
        2. Taking a photo, applying effects, and sharing it
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        3. Using listview to show and search local data
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Do not block the main thread!
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        5. Using SQLite databases to handle a to-do list
          1. Getting ready
          2. How to do it...
          3. There's more...
        6. Using a styled TListView to handle a long list of data
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        7. Taking a photo and location and sending it to a server continuously
          1. Getting ready
          2. How to do it...
            1. The client side
            2. The server side
          3. There's more...
        8. Talking to the backend
          1. Getting ready
          2. How to do it...
          3. There's more...
        9. Making a phone call from your app!
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        10. Tracking the application's life cycle
          1. Getting ready
          2. How to do it...
          3. There's more...
      14. 7. Using Specific Platform Features
        1. Introduction
        2. Using Android SDK Java classes
          1. Getting ready
          2. How to do it...
          3. There's more...
        3. Using iOS Objective-C SDK classes
          1. Getting ready
          2. How to do it...
          3. There's more...
        4. Displaying PDF files in your app
          1. Getting ready
          2. How to do it...
            1. Showing the PDF file on Android
            2. Showing the PDF file on iOS
          3. There's more...
            1. Using Google Docs Viewer
            2. Downloading the PDF file from the server
        5. Sending Android intents
          1. Getting ready
          2. How to do it...
            1. More complex intents – sending a full flagged e-mail
            2. Starting an activity for results – the SpeechToText engine
          3. There's more...
        6. Letting your phone talk – using the Android TextToSpeech engine
          1. Getting ready
          2. How to do it...
          3. There's more...
      15. Index