the code and elaborating on the Intent classes involved. RestaurantFinder uses Intent objects internally, to go from Activity to Activity, and also calls on intents from Android built-in applications—to phone a restaurant, map directions to a restaurant, and visit a restaurant review web page.

After we complete the RestaurantFinder application, we will move on to another sample application in this chapter—WeatherReporter. WeatherReporter will make use of the Yahoo! Weather API to retrieve weather data and display it, along with weather alerts, to the user on the Android platform. Through the course of the WeatherReporter application we will exercise intents in a new way, using a BroadcastReceiver and a Service.

A BroadcastReceiver, as the name implies, also deals with intents but is used to catch broadcasts to any number of interested receivers, rather than to signal a particular action from an Activity. Services are background processes, rather than UI screens, but they are also invoked with a call to action, an Intent.

Lastly in this chapter, in relation to services, we will examine the Android mechanism for making Inter-Process Communication (IPC) possible using Binder objects and the Android Interface Definition Language (AIDL). Android provides a highperformance way for different processes to pass messages among themselves. This is important because every application runs within its own isolated process (for security and performance purposes, owing to the Linux heritage of the platform). To enable communication between components in different processes, something services often need to do, the platform provides a path via a specified IPC approach.

The first thing we need to cover is the basic means to perform an action from within any component; this means focusing on Intent details.

0 0

Post a comment