Chapter 6. Accessing Android Features Using Intents

In the last chapter, we discussed data transfer using components. We saw how to transfer data from one activity to the other, and why we should transfer data between different components. We also discussed the various methods of data transfer using intents. Android has a lot of components in the system, and intent provides an easy interface to make those components communicate with each other. In Chapter 4, Intents for Mobile Components, we discussed the different Android components that use system hardware such as Wi-Fi, Bluetooth, camera, microphone, and so on. We also discussed how these components can be utilized using intents and how we can make many different applications using Android hardware with no more than few lines of code.

Until now, we have only discussed hardware components and the role of intents with those components. This chapter is all about Android software features and how we can use those features in our applications using intents as the primary interface. Android contains a vast collection of libraries and APIs, by which a developer can use different Android features very easily. This chapter will walk us through the common Android features, and we will also develop some example applications that will show us the use of intents with those features.

This chapter includes the following topics:

  • Features of Android OS
  • Android features versus components
  • Common Android OS features
  • Android features and intents
  • The <uses-feature> and <uses-permission> tags
  • Sharing using the SEND action
  • Sending SMS/MMS using intents
  • Sending data messages using intents
  • Confirming message delivery
  • Receiving SMS
  • Telephony and making calls using intents
  • Sending notifications using intents
  • Some other Android features

    Tip

    The concepts and structure of intents, as discussed in previous chapters, are the prerequisites for understanding this and the following chapters. If you don't have the basic concept of these things, we would recommend you to read Chapter 3, Intents and Its Categorization and Chapter 4, Intents for Mobile Components in order to move forward.

Features of Android OS

Android is an open source operating system and middleware framework for smart devices such as phones and tablets. The devices contain lots of features and functionalities that provide users with a way for an easy lifestyle. These features include hardware features such as audio, Bluetooth, camera, network, microphone, GSM, NFC, and sensors such as accelerometer, barometer, compass, gyroscope, and Wi-Fi.

Not only does it include hardware components, it also includes software features such as app widgets, home screen, input methods, live wallpapers, layouts, storage, messaging, multi-language support, browsers, Java support, media support, multi-touch, calls, messaging, multitasking, accessibility, external storage, and so on. We have already referred to the hardware features as mobile components and discussed them in the previous chapters. We will discuss the software features in this chapter with practical examples.

Note

We are using two key terms here: components and features. Components such as camera, Bluetooth, and so on are the hardware parts of an android phone . The feature is the software part of an Android phone, such as an SMS feature, e-mail feature, and so on. This chapter is all about software features, their access, and their use through intents.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.48.181