Book Image

Expert Delphi - Second Edition

By : Marco Cantù, Paweł Głowacki
Book Image

Expert Delphi - Second Edition

By: Marco Cantù, Paweł Głowacki

Overview of this book

Master Delphi, the most powerful Object Pascal IDE and versatile component library for cross-platform native app development, by harnessing its capabilities for building natively compiled, blazingly fast apps for all major platforms, including Android, iOS, Windows, Mac, and Linux. Expert Delphi begins with a quick overview of Delphi, helping you get acquainted with the IDE and the Object Pascal language. The book then quickly progresses to more advanced concepts, followed by the architecture of applications and the FireMonkey library, guiding you through building server-side services, parallel programming, and database access. Toward the end, you’ll learn how to integrate your app with various web services and deploy them effectively. By the end of this book, you’ll be adept at building powerful, cross-platform, native apps for iOS, Android, Windows, and macOS—all from a single code base.
Table of Contents (21 chapters)
Free Chapter
1
Part 1: Building Blocks
6
Part 2: Going Mobile
12
Part 3: From Data to Services
19
Index

Working with JSON

A better format for storing favorite entries is JSON. This is currently the most popular data interchange format. Its strength is its simplicity. The JSON specification is an interesting read and can be found at http://json.org. With a very simple type system, JSON is able to represent complex data structures. One of the key design objectives of JSON is to keep it simple. Most programming languages can process JSON, and Object Pascal is not an exception.

There are two main ways to work with JSON in Delphi. The first approach is to build an in-memory representation of the JSON tree using objects from the System.JSON unit. The second approach is based on streaming and provides sequential access to JSON data. In reality, both ways have their advantages and disadvantages. Let’s look at both.

JSON is a very popular format for sharing information and all kinds of datasets. Imagine you have just locally downloaded a piece of JSON. Now what?

Here is the favorites...