The following components comprise the building blocks for all your Android applications:
Android Training (android fundamental)
By Khaled Anaqwa
WHAT MAKES AN ANDROID
An activity represent a single screen with a
Most applications contain multiple activities
When a new activity starts, it is pushed onto
User interface can built with xml or java(xml is
Monitor lifespan through callback methods
like onStart() , onPause() ,etc
Services perform long-running operations in
Dose not contain a user interface
Useful for things like network operations,
playing music , etc.
Run independently of the component that
Can be bound to by other application
components, if allowed (when all of them
unbind, the service is destroyed)
Used to store and retrieve data and make it
accessible to all applications(the only way to
share data across apps)
They encapsulate the data, and provide
mechanisms for defining data security
connects data in one process with code running
in another process.
Exposes a public URI that uniquely identifies data
Data is exposed as a simple table on DB model
Android contains many providers for things like
contacts, media ,etc
a component that responds to systemwide broadcast announcements
Example :announcing that the screen has
turned off , the battery is low, etc.
App can also initiate their own broadcasts
Contain no user interface
They can create status bar notifications
APPLICATION’S PRIORITY AND
ITS PROCESS’ STATES
Android applications continue running
and in memory until the system needs
resources for other applications.
1. Active processes
(foreground) processes have
application components the user is
Activities in an active state
Broadcast Receivers executing onReceive
Services executing onStart, onCreate
Running Services that have been flagged
to run in the foreground
2. Visible processes
processes are those
Activities. This happens
when an Activity is only
partially obscured (by
a non-full-screen or
3. Started Service processes
hosting Services that have been
started. Because these Services don’t
interact directly with the user, they
receive a slightly lower priority than visible
Activities or foreground Services.
4. Background processes
hosting Activities that aren’t
visible and that don’t have any running
Services. There will generally be a large
number of background processes that
Android will kill using a last-seen-first-killed
pattern in order to obtain resources for
5. Empty processes
improve overall system performance,
Android will often retain an application in
memory after it has reached the end of its
lifetime. Android maintains this cache to
improve the start-up time of applications
when they’re relaunched.
These processes are routinely killed, as
It names the Java package for the application(unique
identifier for the app.)
It describes the components of the application
It determines which processes will host application
It declares which permissions the application must have
permissions that others are required to have in order to
interact with the application's components.
It declares the minimum level of the Android API that
the application requires.
It lists the libraries that the application must be linked
How Android features are
reflected in the manifest file?
Icons and Labels
core components of an application
(its activities, services, and broadcast
receivers) are activated by intents.
An intent is a bundle of information (an
Intent object) describing a desired action
including the data to be acted upon, the
category of component that should
perform the action, and other pertinent
A permission is a restriction limiting access to a
part of the code or to data on the device.
The limitation is imposed to protect critical
data and code that could be misused to
distort or damage the user experience.
here are some permissions defined by
Type of Permissions
namespace for a group of permissions)
<permission-group>(defines a label for a
set of permissions)
(tree-group)It affects only how the
permissions are grouped when presented
to the user.
android:required=["true" | "false"] />
Specifies a shared library that the
application must be linked against. This
element tells the system to include the
library's code in the class loader for the
Google Play uses the <uses-library>
elements declared in your app manifest
to filter your app from devices that do not
meet it's library requirements.
of the android packages such as
android.view (basic user interface classes that
handle screen layout and interaction with the
android.widget (mostly visual UI elements)
are in the default library that all applications
are automatically linked against.
some packages (such as maps) are in
separate libraries that are not
A particular slide catching your eye?
Clipping is a handy way to collect important slides you want to go back to later.