Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

Chapter 10: Integrating Applications wit... > Introducing Windows Phone Launchers ... - Pg. 235

C H A P T E R 10 Integrating Applications with the Windows Phone OS When a third-party application such as yours runs on a Windows Phone, it executes in an environment that is highly restricted. Windows Phone OS must be restrictive in order to protect unsuspecting users of mobile devices from potential malicious application behavior, which may include stealing personal data stored on the phone, dialing phone numbers without the user's knowledge, or corrupting the data stores of other applications. One of the major restrictions that Windows Phone OS places on mobile applications is limiting them to their own execution environment, or sandbox, and not allowing them access to other applications' space or the internals of the operating system. Sandboxing and other Windows Phone security features are covered in greater detail in Chapter 19. Nonetheless, many applications need to access the system features of the phone: for example, to play a music file in the media library, to take a photo, or to send a text message. Windows Phone OS enables such application interactions with the device via a set of Application Programming Interface (API) tasks referred to as launchers and choosers. Some launchers and choosers may be invoked via hardware buttons on the phone, such as using a camera button to take photos. It is also relatively easy to use launchers and choosers from within your application. When one is invoked or when a user presses hardware buttons on the phone while your application is running, however, managing your application state gets a little tricky. This chapter covers the launchers and choosers available on the Windows Phone platform, as well as the various states an application can enter when you invoke them. You also learn about integrating your applications with popular external services such as Facebook. Finally, you take a quick look at Windows Phone hubs, which bring many applications found on desktop devices and in the cloud to the palm of your hand. Introducing Windows Phone Launchers and Choosers When an application executes, the Windows Phone OS confines it to its own space, or sandbox. Both memory and file storage are isolated within that sandbox--one application can't access or alter another's memory or file storage. Neither can one application directly call another or access a shared data store, such as a list of contacts. There are obvious reasons for this behavior; Microsoft must ensure that the Windows Phone platform is as secure and stable as possible, and isolating applications is one giant step toward getting there. A set of built-in APIs provides access to the most common features of Windows Phone. These APIs help you to perform tasks, such as saving a contact's e-mail address or phone number, or placing a phone call (with the mandatory prior-user authorization, of course), that require access to shared resources on the phone. 235