Book Image

Delphi Cookbook

By : Daniele Teti
Book Image

Delphi Cookbook

By: Daniele Teti

Overview of this book

Table of Contents (14 chapters)
Delphi Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using listview to show and search local data


In many cases, on a mobile app, data is read from remote servers and then locally stored to make it available without Internet connection. In this recipe, you'll see how to read and write to a file as well as how to show and search that data in a listview.

Getting ready

This recipe is simple and short, but it is really useful because the concepts exposed are reusable and allow you to gain confidence with some very important best practices. The final aspect of the app is shown in the following screenshot. Note that the Delete button is visible only when an item is selected.

The Simple TODO app; when an item is selected, the Delete button is visible

How to do it...

  1. Create a new mobile app by navigating to File | New | Other… | Delphi Projects | FireMonkey Mobile Application.

  2. Choose the Header/Footer template and click on OK.

  3. As soon as Delphi creates the project template, save all the files with the following names:

    • Save the project as SimpleTODO.dproj...