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

Making a phone call from your app!


Many mobile devices, especially in the consumer market, are phones or are devices that can make phone calls. In some cases, your mobile app may have the ability to make a call or just to monitor the incoming or outgoing calls.

Getting ready

In this recipe, we'll see how to make a call and how to monitor the current calls as well. Also, in this case, the useful FireMonkey platform services framework come handy.

How to do it...

  1. Create a new mobile app by navigating to File | New | FireMonkey mobile application – Delphi.

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

  3. Drop the following components on the main form:

    • TEdit (edtPhoneNumber)

    • TButton (btnCall)

    • TListBox (lbCalls)

    • TListBox (lbInfo)

  4. Arrange the components as shown in the following screenshot:

    The form with all the controls arranged

  5. Put some labels to explain what the listboxes will contain, as shown in the preceding screenshot.

  6. Now, create the FormCreate event handler and fill it with this code:

    procedure...