0% found this document useful (0 votes)
120 views21 pages

Unit II

The document provides an introduction to Android, including what Android is, the basic building blocks of Android like activities, services, and broadcast receivers, UI components like views and notifications, and components for communication like intents and intent filters. It discusses setting up the Android development environment, the Dalvik Virtual Machine, the .apk file format, and Android API levels and versions.

Uploaded by

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

Unit II

The document provides an introduction to Android, including what Android is, the basic building blocks of Android like activities, services, and broadcast receivers, UI components like views and notifications, and components for communication like intents and intent filters. It discusses setting up the Android development environment, the Dalvik Virtual Machine, the .apk file format, and Android API levels and versions.

Uploaded by

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

UNIT-II

UNIT II
Introduction to Android: What is Android? Setting up
development environment, Dalvik Virtual Machine
& .apk file extension, Fundamentals: Basic Building
blocks - Activities, Services, and Broadcast Receivers &
Content providers. UI Components - Views &
notifications. Components for communication -Intents &
Intent Filters, Android API levels (versions & version
names).
Android … What?

Android is a Linux-based platform for


smart devices …
 Which kind of Smart devices … (examples)

SMARTPHONES
3
TABLETS EREADERS ANDROID TV GOOGLE GLASSES
?
What is Android
Android is a software package and linux based operating
system for smart devices such as tablet computers and
smart phones.
It is developed by Google and later the OHA (Open
Handset Alliance).
Java language is mainly used to write the android code
even though other languages can be used.
The goal of android project is to create a successful real-
world product that improves the mobile experience for
end users.

4 L Sukanya
The main advantage of adopting Android is

It offers a unified approach to application


development.

Developers need only develop for Android, and their


applications should be able to run on numerous
different devices, as long as the devices are powered
using Android.

In the world of smart phones, applications are the


most important part of the success chain.

5 L Sukanya
Android is a combination of three components:
 A free, open-source operating system for mobile devices.
 An open-source development platform for creating mobile
applications.
 Devices, particularly mobile phones, that run the Android
operating system and the applications created for it.

6 L Sukanya
Setting up development environment
Android supports java, kotlin, c++, c# etc. language to
develop android applications. Java is the officially
supported language for android. 
There are four tools that you will need and they are
available on the Internet for free:
Java JDK latest version
Android SDK
Eclipse IDE for Java Developers (optional)
Android Development Tools (ADT) Eclipse Plugin
(optional)

7 L Sukanya
Tools used :
JDK 1.6
Eclipse IDE 3.7 , Indigo
Android SDK
Summary steps to develop an Android application :
Install Java(JDK)
Install Android SDK
Create an Android Virtual Device (AVD)
Create Android Project with Eclipse (Wizard)
Code it…
Start it in Android Virtual Device (AVD)

8 L Sukanya
Dalvik Virtual Machine
The Dalvik Virtual Machine (DVM) is an android virtual
machine optimized for mobile devices.
The javac tool compiles the java source file into the class
file.  
The Dex compiler converts the class files into the .dex file
that run on the Dalvik VM. Multiple class files are
converted into one dex file.
The dx tool takes all the class files of your application and
generates a single .dex file. It is a platform-specific tool.
The Android Assets Packaging Tool (aapt) handles the
packaging process.

9 L Sukanya
(Android programs are compiled into .dex (Dalvik
Executable) files, which are in turn zipped into a
single .apk file on the device.)

10 L Sukanya
APK File
An Android Package Kit (APK for short) is

the package file format used by the Android operating


system for distribution and installation of mobile
apps.
Just like Windows (PC) systems use a .exe file for

installing software, the APK does the same for


Android.

11 L Sukanya
12 L Sukanya
Android Core Building Blocks
Four basic components of Android:
Activities
Services
Content Provider
Broadcast Receiver

13 L Sukanya
Android Core Building Blocks
An android component is simply a piece of code that
has a well defined life cycle e.g. Activity, Receiver, Service
etc.
Activity
What is an Activity in Android?
Activity is the entry point in an Android application that
a user can interact with.
 To be more clear, an Activity is each and every single
screen that you look at your Android device to interact
with.
Activities are used to make interactions with the system
(device) and the apps.
14 L Sukanya
15 L Sukanya
“Services” is a component that runs in the background so that it can
perform long, running operations or perform work for remote processes.
EX: Suppose you have an automatic call recorder app on your device and
when a call comes, then it automatically starts recording the call.
Content-Provider:
The Content Providers are components that expose a specific set of data
to applications. They provide the tools to manage access and define
security for the data.
 It is only needed to communicate and share that data outside the
application.
Broadcast Receiver The Broadcast Receiver is a component that can
receive and respond to any broadcast announcements.
For example, Broadcast in android is the system-wide events that can occur
when the device starts, when a message is received on the device or when
incoming calls are received, or when a device goes to an airplane mode, etc. 
16 L Sukanya
Additional Components

Views : UI elements that are drawn on-screen including buttons, list

images etc.
Layouts : View hierarchies that control screen format and

appearance of the views.


Manifest : Configuration file for the application 

Notifications Android allows to put notification into the title bar of

your application. The user can expand the notification bar and by
selecting the notification the user can trigger another activity.
Types of Notifications: 1. Toast Notifications 2. Status Bar

Notifications 3. Dialog Notifications 


17 L Sukanya
Intents and Intent Filters
Android Intent is the message that is passed between
components such as activities, content providers, broadcast
receivers, services etc.
Although intents facilitate communication between
components in several ways, there are three
fundamental use cases:
Start the service
Launch an activity
Display a web page
Display a list of contacts
Broadcast a message
Dial a phone call etc.

18 L Sukanya
Intent types
There are two types of intents:
Explicit intents 
Explicit Intent specifies the component. In such case, intent provides
the external class to be invoked.
Intent i = new Intent(getApplicationContext(), ActivityTwo.class);  st
artActivity(i);  
Implicit intents 
Implicit Intent doesn't specifiy the component. In such case, intent
provides information of available components provided by the system
that is to be invoked.
For example, you may write the following code to view the webpage.
Intent intent=new Intent(Intent.ACTION_VIEW);  
intent.setData(Uri.parse("http://www.javatpoint.com"));  
startActivity(intent);  
19 L Sukanya
Android API levels (versions & version names)

20 L Sukanya
21 L Sukanya

You might also like