O'Reilly logo

Pro Android 4 by Satya Komatineni, Dave MacLean

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

Working with SMS

SMS stands for Short Message Service, but it's commonly called text messaging. The Android SDK supports sending and receiving text messages. We'll start by discussing various ways to send SMS messages with the SDK.

Sending SMS Messages

To send a text message from your application, you need to add the android.permission.SEND_SMS permission to your manifest file and then use the android.telephony.SmsManager class. See Listing 23–1 for the layout XML file and the Java code for this example. If you need to see where the permission goes in the manifest XML file, you can sneak ahead to Listing 23–2.

NOTE: We will give you a URL at the end of the chapter that you can use to download projects of this chapter. This will allow you to ...

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