O'Reilly logo

Flash Development for Android Cookbook by Joseph Labrecque

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making a phone call from an application

With all the great features and sheer power of the Android operating system, it is easy to forget that these devices are primarily telephones. In this recipe, we will demonstrate how to invoke the native Android telephone utility from within an application, passing along a phone number to dial.

How to do it...

Having the application invoke navigateToURL and passing in a new URLRequest with the correct URI of tel: will open the default telephone application along with the specified phone number loaded up and ready to be dialed. In this example, we will perform this action once a TOUCH_TAP event is detected:

  1. First, import the following classes into your project:
    import flash.display.Sprite; import flash.display.StageAlign; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required