Making a phone call from your app
Many mobile devices, especially in the consumer market, are phones or devices that can make phone calls. In some cases, your mobile app may have the capability of making a call or just monitor incoming or outgoing calls.
Getting ready
In this recipe, we'll see how to make a call and how to monitor current calls as well. Also, in this case, the useful FireMonkey platform services framework comes in handy.
How to do it...
- Create a new mobile app by navigating to
File
|New
|Multi-Device Application Delphi
. - Select the
Header/Footer
template and click onOK
. - Drop the following components on the main form:
TEdit
(edtPhoneNumber
)TButton
(btnCall
)TListBox
(lbCalls
)TListBox
(lbInfo
)
- Arrange the components as shown in the following screenshot:
Figure 8.21: The form with all the controls arranged
- Put in some labels to explain what the list boxes will contain, as shown in the preceding screenshot.
- Now, create the
FormCreate
event handler and fill it in with this code:
procedure...