Android Unit-1
Android Unit-1
Session-1
Introduction to Android
In Linux, the kernel is the OS. The software stack sitting on top of the kernel can include
things like:
window manager
Applications for managing the system
So things like a control panel application to edit system settings aren't part of the operating
system. They're part of the software stack on top of the operating system.
Here we start:
The above figure shows the diagram of Android Architecture. The Android OS can be
referred to as a software stack of different layers, where each layer is a group of
several program components. Together it includes operating system, middleware and
important applications. Each layer in the architecture provides different services to the
layer just above it. We will examine the features of each layer in detail.
RENAISSANCE SOFTLABS ANDINTRO 004
ANDROID INTORDUCTION
1.2.1 Linux Kernel
The basic layer is the Linux kernel. The whole Android OS is built on top of the Linux 2.6
Kernel with some further architectural changes made by Google. It is this Linux that
interacts with the hardware and contains all the essential hardware drivers. Drivers are
programs that control and communicate with the hardware. For example, consider the
Bluetooth function. All devices have Bluetooth hardware in it. Therefore the kernel must
include a Bluetooth driver to communicate with the Bluetooth hardware. The Linux kernel
also acts as an abstraction layer between the hardware and other software layers. Android
uses the Linux for all its core functionality such as Memory management, process
management, networking, security settings etc. As the Android is built on a most popular
and proven foundation, it made the porting of Android to variety of hardware, a relatively
painless task.
1.2.2 Libraries
The next layer is the Android’s native libraries. It is this layer that enables the device to
handle different types of data. These libraries are written in c or c++ language and are
specific for a particular hardware.
1.2.3.3 SQLite:
SQLite is the database engine used in android for data storage purposes
1.2.3.4 WebKit:
It is the browser engine used to display HTML content.
1.3.1.1 CoreJavaLibraries
These are different from Java SE and Java ME libraries. However these libraries provide
most of the functionalities defined in the Java SE libraries.
As a developer we are able to write an app which replaces any existing system app. That is,
you are not limited in accessing any particular feature. You are practically limitless and can
whatever you want to do with the android (as long as the users of your app permit it). Thus
Android is opening endless opportunities to the developer.
1. Activities
2. Services
3. Broadcast Receivers
4. Content Providers.
Activity is the basic building block of every visible android application. It provides the
means to render a UI. Every screen in an application is an activity by itself. Though they
work together to present an application sequence, each activity is an independent entity.
Service is another building block of android applications which does not provide a UI. It is a
program that can run in the background for an indefinite period.
Broadcast Receiver is yet another type of component that can receive and respond to any
broadcast announcements.
Content Providers are a separate league of components that expose a specific set of data
to applications.
1. Intents
2. Intent Filters
Intents are messages that are passed between components. One component that wants to
invoke another has to only express its' "intent" to do a job. And any other component that
exists and has claimed that it can do such a job through "intent-filters", is invoked by the
android platform to accomplish the job. This means, both the components are not aware of
each other's existence and can still work together to give the desired result for the end-
user.
This dotted line connection between components is achieved through the combination of
intents, intent-filters and the android platform.
Intent is a bundle of information, a passive data structure that holds an abstract description
f the operation to be performed. (or in the case of broadcasts, a description of an event
that has happened and is being announced).
API Level is an integer value that uniquely identifies the framework API revision offered by a
version of the Android platform.
A device running Android with version X will usually support applications written for API X
and below.
This means if you want your app to support API 8, devices version 8 will be able to run it,
but also devices of version 9, 10, 11, etc.
It lets the Android platform describe the maximum framework API revisions that it
supports.
It lets applications describe the framework API revision that they require
It lets the system to avoid installation of applications on the user’s device, such that version
incompatible applications are not installed on the device.
Each Android platform version stores its API Level identifier internally, in the Android
system itself.
Applications can use a manifest element provided by the framework API ‘<uses-sdk>’ to
describe the minimum and maximum API under which they are able to run, as well as the
preferred API level that they are designed to support. The element offers three key
attributes:
android:minSdkVersion- Specifies the minimum API Level on which the application is able to
run , default value is ‘1’.
android:maxSdkVersion- Specifies the maximum API Level on which the application is able
to run.