Module - 1: Semester Vi Cs/Bca S.A
Module - 1: Semester Vi Cs/Bca S.A
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.
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
• 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.
➢In the case of the Android emulator, the processor is based on ARM
(Advanced RISC Machine).
<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" >
• 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.
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.
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.
➢If the user is currently working with an activity, the system gives
high priority to that application.
• 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
• 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.