Unit- 1 Chapters: 1
INTRODUCTION TO ANDROID
WHAT IS ANDROID
❖ Is an official IDE for developing android applications
❖ It is an open source and simple to use
❖ Written in java
❖ The Android platform is a software stack, and it was designed
primarily, but not exclusively, to support mobile devices such as
phones and tablets.
❖ This stack has several layers, going all the way from low-level
operating system services that manage the device itself, up to
sample applications, things like the phone dialer, the contacts
database, and the web browser. Android also comes with a
software developers kit, or SDK, which is used to create Android
applications.
WHAT ANDROID ISN’T
❖ Android applications are written using the Java language, but they
are not run within a Java ME (Mobile Edition) VM, and Java-
compiled classes and executables will not run natively in
Android.
❖ Android runs on an open-source Linux kernel, but, while their
goals are similar, Android’s complete software stack approach is
different of these standards defining organizations.
❖ Android includes a reference design for mobile handset
manufacturers, but there is no single “Android phone.”
❖ Although Android does include an application layer, “Android’’
also describes the entire software stack, encompassing the
underlying operating system, the API libraries, and the
applications themselves
ANDROID SDK FEATURES
❖ Android gives the opportunity to create applications that are as
much a part of the phone. The following list highlights some of the
most noteworthy Android features:
❖ Enabling you to make or receive calls or SMS messages, or to
send and retrieve data across any mobile networks (GSM,3G, 4G,
LTE…) for telephony or data transfer
❖ Comprehensive APIs for location-based services such as GPS and
network-based location detection
❖ support for applications that integrate map controls as part of their
user interfaces
❖ Wi-Fi hardware access and peer-to-peer connections
❖ Full multimedia hardware control, including playback and
recording with the camera and microphone
ANDROID SDK FEATURES
❖ Access to Hardware, Including Camera, GPS, and Sensors
❖ Data Transfers Using Wi-Fi, Bluetooth, and NFC
❖ Maps, Geocoding, and Location-Based Services
❖ Background Services
❖ SQLite Database for Data Storage and Retrieval
❖ Shared Data and Inter-Application Communication
❖ Using Widgets and Live Wallpaper to Enhance the Home Screen
❖ Extensive Media Support and 2D/3D Graphics
❖ Cloud to Device Messaging
❖ Optimized Memory and Process Management
INTRODUCING THE OPEN HANDSET
ALLIANCE
❖ The Open Handset Alliance (OHA) is a collection of more than 80
technology companies,
❖ Including hardware manufacturers, mobile carriers, software
developers, semiconductor companies, and commercialization
companies.
❖ Prominent mobile technology companies, including Samsung,
Motorola, HTC, T-Mobile, Vodafone, ARM, and Qualcomm.
❖ OHA represents: A commitment to openness, a shared vision for
the future, and concrete plans to make the vision a reality. To
accelerate innovation in mobile and offer consumers a richer, less
expensive, and better mobile experience.
❖ —
www.openhandsetalliance.com
OHA – OPEN HANDSET ALLIANCE
(CONT…)
❖ The OHA hopes to deliver a better mobile software experience for
consumers by providing the platform needed for innovative
mobile development at a faster rate and with higher quality than
existing platforms, without licensing fees for either software
developers or handset manufacturers.
INTRODUCING THE DEVELOPMENT
FRAMEWORK
❖ Android applications normally are written using Java as the
programming language but executed by means of a custom VM
called Dalvik, rather than a traditional Java VM.
❖ Dalvik and the Android run time sit on top of a Linux kernel that
handles low-level hardware interaction, including drivers and
memory management, while a set of APIs provides access to all
the underlying services, features, and hardware.
❖ developing,
The Androidtesting,
SDKand debugging
includes Android applications:
everything you need to start
❖ Android APIs, Development tools, Virtual Manager
Device
(AVD) and emulator, Documentation, Sample
code, support Online
(http://developer.android.com/resources/community-groups.html#ApplicationDeveloperLists)
NATIVE ANDROID APPLICATIONS
❖ Android come with a suit of preinstall applications that are part of
the Android Open Source Project (AOSP), few of them are as
follow:
❖ An e-mail client
❖ An SMS management application
❖ A full PIM (personal information management) suite, including a calendar
and contacts list
❖ A WebKit-based web browser
❖ A music player and picture gallery
❖ A camera and video recording application
❖ A calculator
❖ A home screen
❖ An alarm clock
NATIVE ANDROID APPLICATIONS
❖ Android devices also ship with the following proprietary Google
mobile applications:
❖ The Google Play Store for downloading third-party Android applications
❖ A fully featured mobile Google Maps application, including StreetView,
driving directions, and turn-by-turn navigation, satellite views, and traffic
conditions
❖ The Gmail email client
❖ The Google Talk instant-messaging client
❖ The YouTube video player
TYPES OF ANDROID APPLICATIONS
❖ Most of the applications we create in Android will fall into one of the
following categories:
❖ Foreground — An application that’s useful only when it’s in the
foreground and is effectively suspended when it’s not visible. Ex.
Games
❖ Background — An application with limited interaction that, apart from
when being configured, spends most of its lifetime hidden. These
applications are less common. Ex. include call screening applications,
SMS auto-responders, and alarm clocks.
❖ Intermittent — Most well-designed applications fall into this category.
Applications that expect limited interactivity but do most of their work
in the background. Ex. media player. Email and news applications are
also great examples.
❖ Widgets and Live Wallpapers — Some applications are represented
only as a home-screen. Ex. Widget or as a Live Wallpaper.
ANDROID PLATFORM / STACK
❖ A multi-layered software stack for building and running mobile
applications
❖ The Android software stack is a Linux kernel and a collection of
C/C++ libraries exposed through an application framework that
provides services for, and management of, runtime
applications.
❖ 4 layers architecture
❖ It contains: OS kernel, system libraries, application frameworks
& key apps
ANDROID PLATFORM - LINUX KERNEL
❖ Linux kernel — Core services (including hardware drivers,
process and memory management, security, network and power
management) are handled by a Linux 2.6 kernel.
❖ The kernel also provides an abstraction layer between the
hardware and the remainder of the stack.
❖ Eg. Healthcare Company – converts mobile phone to healthcare
system for measuring hear-rate, ECG, ect for doctor friendly
system
❖ So they recompile the linux kernel by taking necessary
components and removing the unwanted one.
ANDROID PLATFORM - LIBRARIES
❖ Libraries — Running on top of the kernel, Android includes various C/C+
+ core libraries such as libc and SSL, as well as the following:
1) A media library for playback of audio and video media
2) A surface manager to provide display management
3) Graphics libraries that include SGL and OpenGL for 2D and 3D graphics
4) SQLite for native database support
5) SSL and WebKit for integrated web browser and Internet security
❖ Eg. Deal with the camera (like zoom-in, zoom-out), then need to talk to the
drivers from/ using the libraries i.e Hardware Abstraction Layer (HAL)
❖ When a framework API makes a call to access device hardware, the Android
system loads the library module for that hardware component
❖ In this libraries there are “.so” files, created by NDK (Native Development Kit),
which will take the information from the hardware (eg. Camera) and will give
that details to application framework layer and then it goes to the application.
❖ The NDK is designed to enable you to create C++ libraries using the libc and
libm libraries, along with native access to OpenGL.
ANDROID PLATFORM - LIBRARIES
❖ Surface Manager: Responsible for drawing different layers/ windows in the
screen
❖ OpenGL (Graphics Library): is a platform-independent API that allows you to
create hardware-accelerated 3D graphics. Android SDK and NDK together
allow you to write OpenGL ES-related code in both Java and C (* ES i.e.
Embedded System). Cameras and Video recorders etc… uses this OpenGL, can
create 3D graphics and animations
❖ OpenGL ES is a very low-level API. means it doesn't offer any methods
that allow you to quickly create or manipulate 3D objects. Instead, while
working with it, you are expected to manually manage tasks such as
creating the individual vertices and faces of 3D objects, calculating various
3D transformations, and creating different types of shades.
❖ SGL: Used for 2D graphics
❖ Media Framework: Used by audio and video players
❖ SQLite: Use for database related tasks
❖ WebKit: Takes care of browser related activities.
ANDROID PLATFORM - ANDROID RUN
TIME
❖ Just-In-Time compiler, only the modified code will be compiled and run
❖ Android run time —Including the core libraries and the Dalvik VM, the
Android run time is the engine that powers your applications and, along with
the libraries, forms the basis for the application framework.
❖ Core libraries — Although most Android application development is written
using the Java language, Dalvik is not a Java VM. The core Android libraries
provide most of the functionality available in the core Java libraries, as well as
the Android specific libraries.
❖ Dalvik VM — Dalvik is a register-based Virtual Machine that’s been optimized
to ensure that a device can run multiple instances efficiently. It relies on the
Linux kernel for threading and low-level memory management.
❖ The Dalvik VM uses the device’s underlying Linux kernel to handle low-level
functionality, including security, threading, and process and memory
management. It’s also possible to write C/C++ applications that run closer to
the underlying Linux OS.
❖ (Note: its like JVM but for small devices like mobile it works with resource
constraints (with limited environment like CPU power, memory, battery power)
ANDROID PLATFORM – APPLICATION
FRAMEWORK
❖ Contains all different types of managers which keeps any eye on any
event, activity occurs in your application/ program and will keep on
giving information from right over the hardware level to whatever
information has been ask to.
❖ Activity Manager: Manages the lifecycle of the application
❖ Package Manager: An integral part of Android, and will keep track of
how many applications are there in your emulator, what type of
permissions are given to those applications, etc. All the applications’ id
and resources information is held by the packet manager.
❖ Telephony Manager: Manages your incoming calls. As soon as the call
interns, the hardware abstraction layer picks up the call using libraries
and tells the telephone manager that there is a call and then the manager
gives that information to an appropriate application.
ANDROID PLATFORM – APPLICATION
FRAMEWORD
❖ Content Manager: Allows one application data to be access by another
application. Eg. Data of an application of can not be seen or used by another
application by default but the content manage will create a wrapper over the
database and makes the data available to the other process like your contacts,
SMS, photos, can be shared among different applications also.
❖ Location Manager: Shares the information about different locations, current x, y
coordinate positions and so on…using that we can create different applications
❖ Notification Manager: Gives all notifications for any event occurred. Eg. SMS
or call received. It can also relate the changes in hardware and pumps that
information, pop ups the messages from various devices/ hardwares pluged in
with the phone also. Eg. Smoke device,
ANDROID STACK - WORKING EXAMPLE