Modern Operating Systems by Herbert Bos ...
Modern_Operating_Systems_by_Herbert_Bos_and_Andrew_S._Tanenbaum_4th_Ed.pdf-M ODERN O PERATING S YSTEMS
Showing 867-868 out of 1137
Modern Operating Systems by Herbert Bos and Andrew...
Modern_Operating_Systems_by_Herbert_Bos_and_Andrew_S._Tanenbaum_4th_Ed.pdf-M ODERN O PERATING S YSTEMS
Modern Operating Systems by Herbert...
Modern_Operating_Systems_by_Herbert_Bos_and_Andrew_S._Tanenbaum_4th_Ed.pdf-M ODERN O PERATING S YSTEMS
Page 867
CHAP. 10
Activity manager in system_server process
Email app process
1. query()
Client app process
3. Create
4. Return
5. Return
2. Look up
6. query()
Figure 10-61.
Interacting with a content provider.
3. The system finds all activities that can receive data of the identified
MIME type.
A user interface is shown for the user to select one of the possible re-
When one of these activities is selected, the system launches it.
The share-handling activity receives the URI of the data to be shared,
retrieves its data through
, and performs its ap-
propriate operation: creates an email, stores it, etc..
10.8.9 Intents
A detail that we have not yet discussed in the application manifest shown in
Fig. 10-51 is the
tags included with the activities and receiver decla-
rations. This is part of the
feature in Android, which is the cornerstone for
how different applications identify each other in order to be able to interact and
work together.
is the mechanism Android uses to discover and identify activities,
receivers, and services.
It is similar in some ways to the Linux shell’s search path,
which the shell uses to look through multiple possible directories in order to find
an executable matching command names given to it.
There are two major types of intents:
. An
explicit intent
is one that directly identifies a single specific application component; in Linux
shell terms it is the equivalent to supplying an absolute path to a command.

Page 868
SEC. 10.8
most important part of such an intent is a pair of strings naming the component: the
package name
of the target application and
class name
of the component within
that application.
Now referring back to the activity of Fig. 10-52 in application
Fig. 10-51, an explicit intent for this component would be one with package name
and class name
The package and class name of an explicit intent are enough information to
uniquely identify a target component, such as the main email activity in Fig. 10-52.
From the package name, the package manager can return everything needed about
the application, such as where to find its code.
From the class name, we know
which part of that code to execute.
implicit intent
is one that describes characteristics of the desired compo-
nent, but not the component itself; in Linux shell terms this is the equivalent to
supplying a single command name to the shell, which it uses with its search path to
find a concrete command to be run.
This process of finding the component match-
ing an implicit intent is called
intent resolution
Android’s general sharing facility, as we previously saw in Fig. 10-55’s illus-
tration of sharing a photo the user took from the camera through the email applica-
tion, is a good example of implicit intents.
Here the camera application builds an
intent describing the action to be done, and the system finds all activities that can
potentially perform that action.
A share is requested through the intent action
, and we can see in Fig. 10-51 that the email applica-
activity declares that it can perform this action.
There can be three outcomes to an intent resolution: (1) no match is found, (2)
a single unique match is found, or (3) there are multiple activities that can handle
the intent.
An empty match will result in either an empty result or an exception,
depending on the expectations of the caller at that point.
If the match is unique,
then the system can immediately proceed to launching the now explicit intent.
the match is not unique, we need to somehow resolve it in another way to a single
If the intent resolves to multiple possible activities, we cannot just launch all of
them; we need to pick a single one to be launched.
This is accomplished through a
trick in the package manager.
If the package manager is asked to resolve an intent
down to a single activity, but it finds there are multiple matches, it instead resolves
the intent to a special activity built into the system called the
This activity, when launched, simply takes the original intent, asks the package
manager for a list of all matching activities, and displays these for the user to select
a single desired action.
When one is selected, it creates a new explicit intent from
the original intent and the selected activity, calling the system to have that new
activity started.
Android has another similarity with the Linux shell: Android’s graphical shell,
the launcher, runs in user space like any other application.
An Android launcher
performs calls on the package manager to find the available activities and launch
them when selected by the user.

Ace your assessments! Get Better Grades
Browse thousands of Study Materials & Solutions from your Favorite Schools
Concordia University
Great resource for chem class. Had all the past labs and assignments
Leland P.
Santa Clara University
Introducing Study Plan
Using AI Tools to Help you understand and remember your course concepts better and faster than any other resource.
Find the best videos to learn every concept in that course from Youtube and Tiktok without searching.
Save All Relavent Videos & Materials and access anytime and anywhere
Prepare Smart and Guarantee better grades

Students also viewed documents