Book Image

Near Field Communication with Android Cookbook

By : Vitor Subtil
Book Image

Near Field Communication with Android Cookbook

By: Vitor Subtil

Overview of this book

Table of Contents (17 chapters)
Near Field Communication with Android Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Sending a predefined SMS – Part 2


In Part 1 of this recipe, we were able to write a phone number and the SMS content to a tag, but we didn't implement the logic to read it. In this recipe, we will complete the application and create a fully functional application ready for daily use.

Getting ready

Please have a look at the Sending a predefined SMS – Part 1 recipe in Chapter 4, Writing Tag Content – Real-life Examples first, as we need to use the result code files in this recipe.

How to do it...

In Part 2 of the recipe, we will read the URI in the tag and send an SMS. You can jump to step three if you have done Part 1 of the recipe and don't want to create a different project.

  1. Open Eclipse and create a new Android application project named NfcBookCh6Sms and a package named nfcbook.ch6sms.

  2. Import the code and resources files from the Sending a predefined SMS – Part 1 recipe in Chapter 4, Writing Tag Content – Real-life Examples.

  3. With the following code, request permissions to send an SMS:

    <uses...