Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Creative tools for business
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Adobe AIR Developer Center / AIR Quick Starts for ActionScript developers /

Using the tel: and sms: URIs in a mobile phone application

by Sunil Bhaskaran

Sunil Bhaskaran

Content

  • Using the tel: URI scheme
  • Using the sms: URI scheme
  • Using the sms: and tel: URI schemes in a text field
  • Where to go from here

Created

22 November 2010

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
Adobe AIR Flash Builder Flash Professional mobile

Requirements

Prerequisite knowledge

Familiarity with ActionScript 3.

 

Additional Requirements

  • Android 2.2 device or emulator
  • Android SDK

User level

Intermediate

Required products

  • Flash Builder 4 (Download trial)
  • Flash Professional CS5 (Download trial)

A Uniform Resource Identifier (URI) is a string that is used to identify a resource. For example, in a web page, if you click an e-mail ID embedded with the mailto URI, the default e-mail client in your system opens with the e-mail ID in the To list. Adobe AIR 2.5 allows you to use two new URI schemes, tel: and sms: , to access the system phone dialer and system SMS application.

Note that the tel: and sms: URI schemes behave differently on different devices and different platforms. For example, if the SMS program is not properly configured on a device, the sms: URI does not work. Likewise, on the Android platform, the URI scheme must be specified in lowercase.

In this article, you will learn to use:

  • The tel: URI scheme with the navigateToURL() function
  • The sms: URI scheme with the navigateToURL() function
  • The sms: and tel: URI schemes as hyperlinks in a text field

Using the tel: URI scheme

To use the tel:URI scheme to launch the system phone dialer, create a URLRequest object containing the telephone number and pass the object to the navigateToURL method in the flash.net package. The following example illustrates how to do this:

public function call():void { const callURL:String="tel:1234567890"; var targetURL:URLRequest = new URLRequest(callURL); navigateToURL(targetURL); }

When the function is run on a phone, the default dialer is launched with the telephone number already entered. (The user must still initiate the phone call by pressing the call button.)

Figure 1 shows the way a tel: URI opens the telephone dialer on an Android mobile phone.

This is how a tel: URI opens the telephone dialer on an Android mobile phone.
Figure 1. This is how a tel: URI opens the telephone dialer on an Android mobile phone.

Using the sms: URI scheme

You can use the sms: URI scheme exactly the same way you use the tel: URI scheme:

public function sms():void { const callURL:String="sms:1234567890"; var targetURL:URLRequest = new URLRequest(callURL); navigateToURL(targetURL); }

When the function is run on a phone, the default SMS client is launched with the telephone number already entered as shown in Figure 2.

The default SMS client is launched with the telephone number already entered as shown in Figure 2.
Figure 2. The default SMS client is launched with the telephone number already entered.

Note: Setting the body text in the sms: URL is not currently supported due to a limitation of the Android operating system.

Using the sms: and tel: URI schemes in a text field

A TextField object can display simple HTML content. You can use tel: and sms: URI schemes in HTML hyperlinks. For example, the following code creates a text field displaying a hyperlink:

var call:TextField = new TextField(); call.htmlText ="<a href='tel:1234567890'>Call</a>";

When the user taps the Call link, the application launches the system phone dialer. In the same way, you can create hyperlinks containing an sms: URI.

Where to go from here

In this article, you learned about using the tel: and sms: URIs in your applications. For more information, refer to ActionScript APIs specific to mobile AIR applications in the online Help documentation.

More Like This

  • Capturing soft key input
  • Capturing video input in a mobile AIR application
  • Using the StageWebView class
  • Using the Adobe AIR Geolocation APIs on Android

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement