0% found this document useful (0 votes)
19 views84 pages

Module - 1: Semester Vi Cs/Bca S.A

Android is an open-source, Linux-based operating system for mobile devices that allows developers to create applications using a unified framework. It was founded by Android Inc in 2003 and later acquired by Google, with the first commercial version released in 2008. The Android software stack includes a Linux kernel, libraries, runtime, application framework, and applications, providing a comprehensive environment for mobile app development.

Uploaded by

jyothi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views84 pages

Module - 1: Semester Vi Cs/Bca S.A

Android is an open-source, Linux-based operating system for mobile devices that allows developers to create applications using a unified framework. It was founded by Android Inc in 2003 and later acquired by Google, with the first commercial version released in 2008. The Android software stack includes a Linux kernel, libraries, runtime, application framework, and applications, providing a comprehensive environment for mobile app development.

Uploaded by

jyothi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 84

Module – 1

SEMESTER VI CS/BCA
S.A
1.Introduction
to Android Computing Platform
What is Android ?
➢ Android is an open source, Linux based Operating
System for mobile devices such as smart phones, tablet
computers etc.

➢Android Provides a rich application framework that


allows users to build innovative apps and games for mobile
devices in Java language environment.

➢ Android offers a unified approach to application


development for mobile devices which means developers
need only develop for Android, and their applications
should be able to run on different devices powered by
Android.
➢ Android Inc was founded in Palo Alto California by Andi Rubin,
Rich Miner, Nick Siers and Chris White in 2003.

➢ Later it was acquired by Google in 2005.

➢ Android was developed by the Open Handset Alliance, led by


Google, and other companies.

➢ The first beta version of the Android Software Development Kit


(SDK) was released by Google in 2007 whereas the first
commercial version, Android 1.0, was released in September 2008.
➢ The source code for Android is available under free and open source
software licenses.

➢ Google publishes most of the code under the Apache License


version 2.0 and the rest, Linux kernel changes, under the GNU
General Public License version 2.

➢ Nowadays, Android powers not only mobile phones or tablet PCs


and eBook readers, but also IoT devices and even smart bicycles.
NEED FOR ANDROID

➢ Mobile users demand more choice, more opportunities to


customize their phones.

➢ Mobile operators want to provide value added content to their


subscribers.

➢ Mobile developers want a freedom to develop powerful mobile


applications according to user demands with minimal effort.

➢ Mobile manufacturers want a stable, secure, affordable platform to


power their devices.
Why Android ?
Features of Android
➢Android is a powerful operating system with many advanced
features. Few of them are listed below:

Feature Description
Beautiful UI Android OS basic screen provides a beautiful and
intuitive user interface.
Connectivity GSM/EDGE, IDEN, CDMA, EV-DO, UMTS,
Bluetooth, Wi-Fi, LTE, NFC and WiMAX.
Storage SQLite, a lightweight relational database, is used for
data storage purposes.
Media support H.263, H.264, MPEG-4 SP, AMR, AMR-WB, AAC,
HE-AAC, AAC 5.1, MP3, MIDI, Ogg Vorbis, WAV,
JPEG, PNG, GIF, and BMP
Messaging Supports SMS and MMS
Web browser Based on the open-source WebKit layout engine,
coupled with Chrome's V8 JavaScript engine
supporting HTML5 and CSS3.
Multi-touch Android has native support for multi-touch which was
initially made available in handsets such as the HTC
Hero.
Multi-tasking User can jump from one task to another and same time
various application can run simultaneously.
Resizable Widgets are resizable, so users can expand them to
widgets show more content or shrink them to save space

Multi- Supports single direction and bi-directional text.


Language
GCM Google Cloud Messaging (GCM) is a service that lets
developers send short message data to their users on
Android devices, without needing a proprietary sync
solution.( C2DM Cloud to Device Messaging )
Wi-Fi Direct A technology that lets apps discover and pair directly,
over a high-bandwidth peer-to-peer connection.

Android Beam A popular NFC-based technology that lets users


instantly share, just by touching two NFC-enabled
phones together.
Categories
of Android applications
➢There are many android applications in the market. The top
categories are:
NATIVE ANDROID APPLICATIONS

➢ Android devices typically come with a set of preinstalled


applications that developed under Android Open Source
Project(AOSP).
➢ An email client.
➢ An SMS management application.
➢ A full PIM(Personal Information Management) including calendar,
contact list.
➢ A calculator.
➢ An alarm clock.
➢ Camera and video recording application.
➢ WebKit based web browser.
GOOGLE PROVIDED APPICATIONS

➢ Android devices may also include proprietary Google applications


:
➢ Google Play store for downloading third party android
applications.
➢ Gmail Client
➢ YouTube video player
➢ Google Talk
➢ Google Map
2.History of Android
➢The code names of android ranges alphabeticaly, such as
Alpha(Astro), Beta, Cupcake, Donut, Eclair, Froyo, Gingerbread,
Honeycomb, Ice Cream Sandwich, Jelly Bean, KitKat and Lollipop,
Marshmallow, Nougat, Pie, Android 10.0and Android 11.0.
Android History
➢Android Timeline
➢ Android 10.0 was initially named Android Q.
➢ Android 11.0 is the eleventh major version of the
Android operating system.
➢ The Android platform provides a framework API that
applications can use to interact with the underlying
Android Android system.
➢ API Level is an integer value that uniquely identifies
History. the framework API revision offered by a version of
the Android platform.
➢ Each Android platform version supports exactly one
API Level, although support is implicit for all earlier
API Levels (down to API Level 1).
3.Android Software Stack
➢Android operating system is a stack of software components which
is roughly divided into five sections.
➢The android software stack is a Linux kernal and collection of
libraries exposed through an application framework that provides
services to applications.
1). Linux Kernel
➢At the bottom of the layers is Linux Kernal - Linux 3.6 with
approximately 115 patches.
➢This provides a level of abstraction between the device hardware
and it contains all the essential hardware drivers like camera,
keypad, display etc.
➢ Also, the kernel handles networking and a vast array of device
drivers.
2). Libraries
➢On top of Linux kernel there is a set of libraries including open-
source Web browser engine WebKit, well known library libc, SQLite
database which is a useful repository for storage and sharing
application data, media libraries to play and record audio and video,
SSL libraries responsible for Internet security etc.

➢A summary of some Java based core Android libraries available to


the Android developer is as follows −

❖android.app − Provides access to the application model and


is the cornerstone of all Android applications.
❖android.content − Facilitates content access, publishing and
messaging between applications and application components.
❖android.database − Used to access data published by content
providers and includes SQLite database management classes.
❖android.opengl − A Java interface to the OpenGL ES 3D
graphics rendering API.
❖android.os − Provides applications with access to standard
operating system services including messages, system services
and inter-process communication.
❖android.text − Used to render and manipulate text on a
device display.
❖android.view − The fundamental building blocks of
application user interfaces.
❖android.widget − A rich collection of pre-built user interface
components such as buttons, labels, list views, layout managers,
radio buttons etc.
❖android.webkit − A set of classes intended to allow web-
browsing capabilities to be built into applications.
3). Android Runtime
➢This is the third section of the architecture.
➢This section provides a key component called Dalvik Virtual
Machine which is a kind of Java Virtual Machine specially designed and
optimized for Android.
➢The Dalvik VM makes use of Linux core features like memory
management and multi-threading, which is intrinsic in the Java
language.
➢The Android runtime also provides a set of core libraries which enable
Android application developers to write Android applications using
standard Java programming language.
DVM AND ART

• The Dex compiler converts the class files into the .dex
file. The DEX bytecode format is translated to native machine
code via either ART or the Dalvik runtimes. Here DEX
bytecode is independent of device architecture.

• Dalvik is a JIT (Just in time) compilation based engine. There


were drawbacks to use Dalvik hence from Android 4.4 (kitkat)
ART - Android Run Time, was introduced as a runtime and
from Android 5.0 (Lollipop) it has completely replaced
Dalvik.
Key Point: Dalvik used JIT (Just in time) compilation whereas ART uses
AOT (Ahead of time) compilation. With the Dalvik JIT compiler, each time
when the app is run, it dynamically translates a part of the Dalvik bytecode
into machine code. ART is equipped with an Ahead-of-Time compiler.
During the app’s installation phase, it statically translates the DEX bytecode
into machine code and stores in the device’s storage. This is a one-time event
which happens when the app is installed on the device. With no need for JIT
compilation, the code executes much faster.
4). Application Framework
➢The Application Framework layer provides many higher-level
services to applications in the form of Java classes.
➢The Android Application framework includes the following key
services −
Activity Manager − Controls all aspects of the application
lifecycle and activity stack.
Content Providers − Allows applications to publish and share
data with other applications.
Resource Manager − Provides access to non-code embedded
resources such as strings, color settings and user interface layouts.
Notifications Manager − Allows applications to display alerts
and notifications to the user.
View System − An extensible set of views used to create
application user interfaces.
5). Applications

➢On the top of android framework, there are applications.


➢All applications such as home, contact, settings, games, browsers
are using android framework that uses android runtime and libraries.
➢Both native and third party applications are built on application
layer by means of API libraries.
4.Developing an End-User Application
with the Android SDK

➢The high-level Android Java APIs are used to develop end-user


applications for an Android handheld device.

a).The Android Emulator


➢The Android SDK(Software Development Toolkit) ships with an
Eclipse plug-in called Android Development Tools (ADT).
➢Android SDK can be used without using ADT; command-line tools
are used instead.
➢Both approaches support an emulator that you can use to run,
debug, and test your applications.
➢You will not even need the real device for 90 percent of your
application development.
➢Android emulator mimics most of the device features, but some
limitations are faced while using USB connections, camera and video
capture, head- phones, battery simulation, and Bluetooth.

➢ The Android emulator accomplishes its work through an open


source “processor emulator” technology called QEMU
(http://bellard.org/qemu/) developed by Fabrice Bellard.

➢In the case of the Android emulator, the processor is based on ARM
(Advanced RISC Machine).

➢ARM is a 32-bit microprocessor architecture based on RISC


(Reduced Instruction Set Computer), in which design simplicity and
speed is achieved through a reduced number of instructions in an
instruction set.
JDK and Android IDE
➢JDK provides Java Compiler and Java Runtime Environment,
which are required to run Java programs in the system.

➢There are so many Android IDE available to develop android


applications. Android Studio, Eclipse IDE etc.
b).The Android UI
➢Android uses a UI framework that resembles other desktop-based,
full-featured UI frame-works, but it’s more modern and asynchronous
in nature.
➢ Programming in the Android UI involves declaring the interface
in XML files.
➢ These XML view definitions are loaded as windows in UI
application.
➢ Even menus in the application are loaded from XML files.
➢Screens or windows in Android are often referred to as
activities, which comprise multiple views that a user needs in order
to accomplish a logical unit of action.

➢Views are Android’s basic UI building blocks, and can further be


combined to form composite views called view groups.
c).The Android Fundamental Components

➢The Android UI framework, along with many other parts of


Android, relies on a new concept called an intent.

➢An intent is an intra- and interprocess mechanism to invoke


components in Android.

➢A component in Android is a piece of code that has a well defined


life cycle. (Activity, Content Provider, Broadcast receivers, services)

➢An activity representing a window in an Android application is a


component.

➢A service that runs in an Android process and serves other clients is


a component.
➢A broadcast receiver that responds to an event or messages from
another applications is an example of a component in Android.

➢Another new concept in Android is the content provider. A content


provider is an abstraction of a data source and it handles data and
database management.

d). Advanced UI Concepts

➢XML page-layout definitions (similar to HTML web pages) play a


critical role in describing the Android UI.
➢Let’s look at an example of how an Android layout XML file does
this for a simple layout containing a text view:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android =
“http://schemas.android.com/apk/res/android
xmlns:tools="http://schemas.android.com/tools" >

<TextView
android:id="@+id/textViewId"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="hello"/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
➢The encoding declaration identifies which encoding is used to
represent the characters in the document.

<LinearLayout xmlns:android =
“http://schemas.android.com/apk/res/android
xmlns:tools="http://schemas.android.com/tools" >

➢Android has a dedicated XML namespace intended for tools to be


able to record information in XML files. The layout can be relative,
linear etc.
<TextView android:id="@+id/textViewId"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="hello"/>
➢Android:layout_width :- Textview Width
➢Android:layout_height :- Textview height
➢Android:id :- Textview Id
➢Android:Text :- Display Text
e). Android Service Components
➢Security is a fundamental part of the Android platform.
➢In Android, security spans all phases of the application life cycle—
from design-time policy considerations to runtime boundary checks.
➢Location-based service is another of the more exciting components
of the Android SDK.
➢This portion of the SDK provides application developers with APIs
to display and manipulate maps, as well as obtain real-time device-
location information.
f). Android Media and Telephony Components
➢Android has APIs that cover audio, video, and telephony
components.
5. Android Java Packages

android.accounts Provides classes to manage accounts such as


Google, Facebook , and so on. The primary classes are
AccountManager and Account

android.animation These classes provide functionality for the property


animation system, which allows you to animate object
properties of any type. int, float, and hexadecimal color
values are supported by default.

android.app Contains high-level classes encapsulating the overall


Android application model.

android.app.backup Provides classes for applications to back up and


restore their data when people switch their devices.
android.appwidget Contains the components necessary to create "app
widgets", which users can embed in other applications
(such as the home screen) to quickly access application
data and services without launching a new activity.

android.bluetooth Provides classes that manage Bluetooth functionality,


such as scanning for devices, connecting with devices,
and managing data transfer between devices. The
Bluetooth API supports both "Classic Bluetooth" and
Bluetooth Low Energy.

android.content Contains classes for accessing and publishing data on a


device.
android.content.pm Contains classes for accessing information about an
application package, including information about its
activities, permissions, services, signatures, and
providers.
android.content.res Contains classes for accessing application resources,
such as raw asset files, colors, drawables, media or
other other files in the package, plus important device
configuration details (orientation, input types, etc.) that
affect how the application may behave.

android.database Contains classes to explore data returned through a


content provider.
android.database.sqlite Contains the SQLite database management classes
that an application would use to manage its own
private database.
android.databinding Contains components used when developing applications
with data binding.
android.drm Provides classes for managing DRM ( Digital Right
Management) content and determining the capabilities
of DRM plug-ins (agents).
android.gesture Provides classes to create, recognize, load and save
gestures.
android.graphics Provides low level graphics tools such as canvases, color
filters, points, and rectangles that let you handle drawing
to the screen directly.
android.graphics.drawa Provides classes to manage a variety of visual elements
ble that are intended for display only, such as bitmaps and
gradients.
android.graphics.drawa Contains classes for drawing geometric shapes.
ble.shapes
android.graphics.pdf Contains classes for manipulation of PDF content.

android.hardware Provides support for hardware features, such as the


camera and other sensors.
android.hardware.usb Provides support to communicate with USB hardware
peripherals that are connected to Android-powered devices.

android.location Contains the framework API classes that define Android


location-based and related services.
android.media Provides classes that manage various media interfaces in
audio and video.
android.os Provides basic operating system services, message passing,
and inter-process communication on the device.
android.provider Provides convenience classes to access the content
providers supplied by Android.
android.telephony Provides APIs for monitoring the basic phone information,
such as the network type and connection state, plus utilities
for manipulating phone number strings.
android.text Provides classes used to render or track text and text
spans on the screen.
android.view Provides classes that expose basic user interface classes
that handle screen layout and interaction with the user.
android.webkit Provides tools for browsing the web.
android.widget The widget package contains (mostly visual) UI
elements to use on your Application screen.
8. Fundamental Components
➢Every application framework has some key components that
developers need to understand before they can begin to write
applications based on the framework.

• Views
• Activities
• Fragments
• Intents
• Content Providers
• Services
• Broadcast receivers
• Android Manifest.xml
• Resources
• Layout
Views
➢Every item in a user interface is a subclass of the Android View class (to be
precise android.view.View).
➢The Android SDK provides a set of pre-built views that can be used to
construct a user interface.
➢Typical examples include standard items such as the Button, CheckBox,
ProgressBar and TextView classes.
➢Such views are also referred to as widgets.
➢A view can also be comprised of multiple other views (otherwise known as a
composite view).
➢Such views are sub classed from the Android ViewGroup class
(android.view.ViewGroup).
Activities
➢An Activity is an application component that provides a screen
with which users can interact in order to do something such as dial
the phone, take a photo, send an email, or view a map.

➢Android system initiates its program with in an Activity starting


with a call on onCreate() callback method.

➢public class MainActivity extends Activity


{
//code
}
Callback Description

onCreate() This is the first callback and called when the activity is first created.

onStart() This callback is called when the activity becomes visible to the user.

onResume() This is called when the user starts interacting with the application.

The paused activity does not receive user input and cannot execute any
onPause() code and is called when the current activity is being paused and the
previous activity is being resumed.

onStop() This callback is called when the activity is no longer visible.

onDestroy() This callback is called before the activity is destroyed by the system.

onRestart() This callback is called when the activity restarts after stopping it.
Example of Activity
Fragments
➢When a screen is large, it becomes difficult to manage all of its
functionality in a single activity.
➢Fragments are like sub-activities, and an activity can display one or more
fragments on the screen at the same time.
➢Multiple fragments can be combined in a single activity to build a multi-
pane UI and reuse a fragment in multiple activities.
➢Fragment Is a modular section of an activity, which has its own lifecycle,
receives its own input events, and which you can add or remove while the
activity is running (sort of like a "sub activity" that you can reuse in
different activities).
Example of Fragment
To create Fragment
➢To create a fragment, first create a subclass of Fragment (or
an existing subclass of it). The Fragment class has code that
looks a lot like an Activity. It contains callback methods
similar to an activity, such
as onCreate(), onStart(), onPause(), and onStop().
Intents
➢An intent generically defines an “intention” to do some work. Intent are
messaging components in android used for communicating between the
components of an Application and also from one application to another
application.
➢Intents are used by the system to notify your application of specific events
(such as the arrival of a text message).
➢An Intent is a messaging object used to request an action from
another application component.
➢Intents loosely couple the action and action handler.
➢Intents can be explicit or implicit.
Explicit Intent
➢Explicit intent connects the internal world of application. Suppose
if you wants to connect one activity to another activity, we can do
this by explicit intent, below image is connecting first activity to
second activity by clicking button.

➢Explicit intents are often used to activate components in same


applications.
Implicit Intent
➢The implicit intents do not name a
target and the field for the component
name is left blank. Just specify the action
that is to be performed by an Intent. Then
android operating system will filter out
component which will response to the
action.
➢Implicit intents are often used to
activate components in other
applications.
➢The target component which receives
the intent can use the getExtras() method
to get the extra data sent by the source
component.
Content Providers
➢A content provider manages access to a central repository of
data.
➢ A provider is part of an Android application, which often provides
its own UI for working with the data.
➢However, content providers are primarily intended to be used by
other applications, which access the provider using a provider client
object.
➢Content providers centralize
content in one place and have
many different applications access
it as needed.
➢A content provider behaves very
much like a database where you can
query it, edit its content, as well as
add or delete content using insert(),
update(), delete(), and query()
methods.
➢In most cases this data is stored in
an SQlite database.
➢ A content provider is implemented as a subclass of
ContentProvider class.

➢ public class MyContentProvider extends ContentProvider


{
public void onCreate()
{
//code;
}
}
Services
➢Services are background processes that can potentially run for a
long time.
➢Android defines two types of services: local services and remote
services.
➢Local services are components that are only accessible by the
application that is hosting the service.
➢Conversely, remote services are services that are meant to be
accessed remotely by other applications running on the device.
➢A service is implemented as a subclass of Service class.

➢public class MyService extends Service


{
//code
}
Example of Services
Broadcast Receivers
• Broadcast Receivers simply respond to broadcast messages from
other applications or from the system itself.
• For example, applications can also initiate broadcasts to let other
applications know that some data has been downloaded to the
device and is available for them to use, so this is broadcast receiver
who will intercept this communication and will initiate appropriate
action.
• Broadcast Receivers allow us to register for the system and
application events, and when that event happens, then the register
receivers get notified.
Android Manifest.xml
➢The AndroidManifest.xml file contains information of your
package, including components of the application such as activities,
services, broadcast receivers, content providers etc.
➢It is the configuration file for application.
➢It performs some other tasks also:
✓It is responsible to protect the application to access any
protected parts by providing the permissions.
✓It also declares the android API that the application is going to
use.
✓It lists the instrumentation classes.
➢The instrumentation classes provides profiling and other
information.
➢These information are removed just before the application is
published etc.
10. Structure of android application
Artifact Description
AndroidManife ➢The Android application descriptor file.
st.xml ➢This file defines the activities, content providers, services,
and intent receivers of the application.
➢You can also use this file to declaratively define
permissions required by the application, as well as grant
specific permissions to other applications using the services
of the application.
src file A folder containing all of the source code of the application.
assets An arbitrary collection of folders and files.
res A folder containing the resources of the application. This is
the parent folder of drawable, anim, layout, menu, values,
xml, and raw.
Drawable A folder containing the images or image-descriptor files used
by the application.
Animator A folder containing the XML-descriptor files that describe
the animations used by the application. On older Android
versions, this is called anim.
Layout A folder containing views of the application. You should
create your application’s views by using XML descriptors
rather than coding them.
Menu A folder containing XML-descriptor files for menus in the
application.
Values A folder containing other resources used by the application.
Examples of resources found in this folder include strings,
arrays, styles, and colors.
Xml A folder containing additional XML files used by the
application.
Raw A folder containing additional data possibly non XML data
that is required by the application.
11. Application life cycle.

➢The life cycle of an Android application is strictly managed by


the system, based on the user’s needs, available resources, and so
on.
➢A user may want to launch a web browser, for example, but the
system ultimately decides whether to start the application.

➢If the user is currently working with an activity, the system gives
high priority to that application.

➢Conversely, if an activity is not visible and the system determines


that an application must be shut down to free up resources, it shuts
down the lower-priority application.
➢Specifically, the Android application architecture is component-
and integration-oriented.

➢Life-Cycle Methods of an Activity


✓ protected void onCreate(Bundle savedInstanceState);
✓ protected void onStart();
✓ protected void onRestart();
✓ protected void onResume();
✓ protected void onPause();
✓ protected void onStop();
✓ protected void onDestroy();
Callback Description
onCreate() This is the first callback and called when the activity is
first created.

onStart() This callback is called when the activity becomes visible


to the user.
onResume() This is called when the user starts interacting with the
application.
The paused activity does not receive user input and cannot
onPause() execute any code and called when the current activity is
being paused and the previous activity is being resumed.

onStop() This callback is called when the activity is no longer


visible.

onDestroy() This callback is called before the activity is destroyed by


the system.

onRestart() This callback is called when the activity restarts after


stopping it.
The Three Lives of Android

• The Entire Lifetime: The period between the first call


to onCreate() to a single final call to onDestroy(). We may think of
this as the time between setting up the initial global state for the app
in onCreate() and the release of all resources associated with the app
in onDestroy().

The Visible Lifetime: The period between a call to onStart() until a
corresponding call to onStop(). Although this is termed the "visible
lifetime", the app may not be directly visible and interacting with
the user at any one time if it is not in the foreground.

The Foreground Lifetime: The period between a call
to onResume() until a corresponding call to onPause(). During
foreground lifetime the activity is in front of all other activities and
interacting with the user.
Priorities of Android Application
• In order to have a proper memory and battery management in the Android
device, Android pushes or kills the applications that are having less priority.
In order to free up some space from the Android device, Android uses some
sets of rules and assign priorities to the applications based on the current
running states of the applications. Following are the process status that are
associated with the Android Application:
• Note: Priorities are ranked in a higher to lower fashion

• Foreground process: A process is said to be in the foreground state if a


user interacts with that process. So, the applications that are on the
foreground have the highest priority. 1

• Visible process: A process is said to be in the visible state when the activity
of the application can be visible but not in the foreground . Let’s have an
example, whenever you are using some application that requires some kind
of permission then you are using the visible process. 2
• Service process: A process is said to be a Service process if it
is currently running but it does not come under the above two
categories i.e. the foreground and the visible process. This is
helpful for those applications that perform some background
task such as downloading some data or uploading some data. 3

• Background process: A process is said to be in background


state if it’s onStop() method is being called by the Android.
Suppose you are using some application and you suddenly
press the home button of your mobile then at that time, your
application will go to the background state from the
foreground state. Also, the application will be placed in the
LRU cache so that it will be called whenever the user reopens
the app. 4
• Empty process: A process is said to be in the empty state if it doesn’t come
under the category of the above four mentioned process states. In an empty
process, there is no active component of the application i.e. each and every
component of the process will the in stop state. 5

• All processes in the empty list are added to a least recently used list (LRU
list). The processes which are at the beginning of this lists will be the ones
killed by the out-of-memory killer.
States of an activity
Table 2. Activity state

State Description
Running Activity is visible and
interacts with the user.
Paused Activity is still visible but
partially obscured, instance is
running but might be killed by
the system.
Stopped Activity is not visible,
instance is running but might
be killed by the system.
Killed Activity has been terminated
by the system of by a call to
its finish() method.
Inter App Integration
The framework allows your app to start other apps from within
its UI.
Open Handset Alliance
➢The Open Handset Alliance (OHA) is a consortium of 84 firms to
develop open standards for mobile devices.
➢Member firms include Google, HTC, Sony, Dell, Intel , Motorola
,Qualcomm, Texas Instruments, Samsung Electronics, LG
Electronics, T-Mobile, Sprint Corporation, Nvidia, and Wind River
Systems.
➢The OHA was established on 5 November 2007, led by Google with
34 members, including mobile handset makers, application developers,
some mobile carriers and chip makers.
➢Android, the flagship software of the alliance, is based on an open-
source license and has competed against mobile platforms from Apple
, Microsoft, Nokia (Symbian), HP (formerly Palm),Samsung
Electronics / Intel (Tizen, bada), and BlackBerry.
Google Cloud Messaging
➢Google Cloud Messaging (commonly referred to as GCM) is a
mobile notification service developed by Google that enables third-
party application developers to send notification data or information
from developer-run servers to applications that target the Google
Android Operating System, as well as applications or extensions
developed for the Google Chrome internet browser.
➢It is available to developers free of charge.
Android Beam
➢Android Beam is a feature of the Android mobile operating system
that allows data to be transferred via near field communication (NFC).
➢ It allows the rapid short-range exchange of web bookmarks, contact
info, directions, YouTube videos, and other data.
➢Android Beam was introduced in Android version 4.0 (Ice Cream
Sandwich).
What is a Kernel ?
➢A kernel is the lowest level of easily replaceable software that
interfaces with the hardware in your computer.

➢It is responsible for interfacing all of your applications to the physical


hardware. It also allows processes, known as servers, to get information
from each other using inter-process communication (IPC).
android.app
➢It Contains high-level classes encapsulating the overall Android application
model.
➢An Activity is an application component that provides a screen with which users
can interact in order to do something, such as dial the phone, take a photo, send an
email, or view a map. An activity can start other activities, including activities that
live in separate applications.
➢A Service is an application component that can perform long-running operations
in the background without a user interface. For example, a service can handle
network transactions, play music, or work with a content provider without the user
being aware of the work going on.
Android.content
➢It Contains classes for accessing and publishing data on a device. It includes
three main categories of APIs:
➢Content sharing (android.content) For sharing content between application
components. The most important classes are:
❖ContentProvider and ContentResolver for managing and publishing
persistent data associated with an application.
❖Intent and IntentFilter, for delivering structured messages between
different application components—allowing components to initiate other
components and return results.
➢Package management (android.content.pm) For accessing information
about an Android package (an .apk).
❖The most important class for accessing this information is PackageManager.

➢Resource management (android.content.res)For retrieving resource


data associated with an application.
❖ such as strings, drawables, media, and device configuration
details.
Android.database
➢It Contains classes to explore data returned through a content provider.
➢If you need to manage data in a private database, use
the android.database.sqlite classes.
➢These classes are used to manage the Cursor object returned from a content
provider query.
➢Databases are usually created and opened with openOrCreateDatabase (String,
int, SQLiteDatabase. CursorFactory)
➢ To make requests through content providers, you can use
the content.ContentResolver class.

You might also like