Chapter 5

SMS Messaging and Networking

WHAT YOU WILL LEARN IN THIS CHAPTER

  • Sending SMS messages programmatically from within your application
  • Sending SMS messages using the built-in Messaging application
  • How to receive incoming SMS messages
  • How to build a location tracker application
  • Sending e-mail messages from your application
  • Connecting to the Web using HTTP
  • How to consume Web services

Once your basic Android application is up and running, the next interesting thing you can add to it is the capability to communicate with the outside world. You may want your application to send an SMS message to another phone when an event happens (such as when you reach a particular geographical location), or you may wish to access a Web service that provides certain services (such as currency exchange, weather, etc.). In this chapter, you learn how to send and receive SMS messages programmatically from within your Android application.

You will also learn how to use the HTTP protocol to talk to web servers so that you can download text and binary data. The last part of this chapter shows you how to parse XML files to extract the relevant parts of an XML file — a technique that is useful if you are accessing Web services.

Get Beginning Android now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.