With all of the technical wizardry and touchscreen goodness that are now packed into modern smartphones, it's easy to forget that their primary function is still that of a telephone—being capable of making and receiving voice calls. There may be times, however, when the user's device is not capable of performing a call for whatever reason (poor network service; lack of call functionality, that is, an iPod touch user; and so on).
In this recipe, we will attempt to make a phone call, first checking the device's capabilities, and throwing an error message when a phone call is not possible.
The complete source code for this recipe can be found in the
/Chapter 11/Recipe 5 folder.