Unit 1
Unit 1
Unit 1
Overview of Android
Content
Introduction to Android
Android System with Architecture
The Android Application Components
Android manifest file
Downloading and Installing Android
Platforms / Versions
Setup Android Environment
SDK
AVD
Developing and Executing the first Android Application
Introduction to Android
Android is an open source mobile platform which consists of 3 things:
Operating System (Linux Kernel)
Middleware
Android / key Application
Android is an open source, Linux-based software stack created for a wide array of devices
and form factors.
It supports devices like mobile phones and other devices, such as tablets, watch, TV, &
auto.
The company named Open Handset Alliance developed Android for the first time that is
based on the modified version of the Linux kernel and other open-source software.
Google sponsored the project at initial stages and in the year 2005, it acquired the whole
company.
In September 2008, the first Android-powered device launched in the market.
Android also provides a marketplace (Play Store) to distribute apps.
It conquered around 75% of the global market share by the end of 2020.
Basic Android Architecture
Android Application
Application Frameworks
Middleware
Android Runtime
The building blocks are components that you use as an developer to build
Android apps.
Main building blocks of android are
Activities
An activity is usually a single screen that the user sees on the device at one time.
public class MainActivity extends Activity{
}
Intents
Intents are messages that are sent among the major building blocks.
Building Blocks
Services
Servicesrun in the background and don’t have any user interface
components.
Same as Activity
For example,
A service might play music in the background while the user is in a different
application,
It might fetch data over the network without blocking user interaction with an
activity.
A service is implemented as a subclass of Service class as follows −
public class MyService extends Service {
}
Building Blocks
Content Providers
Content providers are interfaces for sharing data between applications.
The role of the content provider is like a central repository in which data of the applications
are stored, and it facilitates other applications to securely access and modifies that data
based on the user requirements.
For example,
Contacts Provider is a content provider that exposes
all user contact data to various applications.
Settings Provider exposes system settings to various
applications, including the built-in Settings
application.
Media Store is responsible for storing and sharing
various media, such as photos and music, across
various applications.
Building Blocks
Content Providers
Broadcast Receivers
Broadcast receivers are Android’s implementation of a system-
wide publish/subscribe mechanism, or more precisely, an Observer
pattern.
For example, when an SMS arrives, a call comes in, the battery runs
low, or the system gets booted, all those events are broadcasted, and
any number of receivers could be triggered by them.
Broadcast receivers themselves do not have any visual representation,
nor are they actively running in memory. But when triggered, they get
to execute some code, such as starting an activity, a service, or
something else.
Building Blocks
Broadcast Receivers
public class MyReceiver extends BroadcastReceiver{
public void onReceiver(context,intent){
}
}
Building Blocks
Application Context
Above components are used to make an application.& They live inside the same
application context.
Application context refers to the application environment and the process within
which all its components are running.
It allows applications to share the data and resources between various building
blocks.
An application context gets created whenever the first component of this
application is started up.
Application context lives as long as your application is alive.
Using following methods we can obtain a reference to the context
Context.getApplicationContext()
Activity.getApplication().
Android Platforms
The Android platform is a platform for mobile devices that uses a modified
Linux kernel.
The Android Platform was introduced by the Open Handset Alliance in
November of 2007.
Most applications that run on the Android platform are written in the Java
programming language.
To create an application for the platform, a developer requires the Android
SDK, which includes tools and APIs.
Android Versions
Android Versions
Name Version Number Release Date API Level
Cupcake 1.5 April 27, 2009 3
Donut 1.6 September 15, 2009 4
Eclair 2.0 – 2.1 October 26, 2009 5–7
Froyo 2.2 – 2.2.3 May 20, 2010 8
Gingerbread 2.3 – 2.3.7 December 6, 2010 9 – 10
Honeycomb 3.0 – 3.2.6 February 22, 2011 11 – 13
Ice Cream Sandwich 4.0 – 4.0.4 October 18, 2011 14 – 15
Jelly Bean 4.1 – 4.3.1 July 9, 2012 16 – 18
KitKat 4.4 – 4.4.4 October 31, 2013 19 – 20
Lollipop 5.0 – 5.1.1 November 12, 2014 21 – 22
Marshmallow 6.0 – 6.0.1 October 5, 2015 23
Nougat 7.0 – 7.1.2 August 22, 2016 24 – 25
Oreo 8.0 – 8.1 August 21, 2017 26 – 27
Pie 9 August 6, 2018 28
Android 10 10 September 3, 2019 29
Android 11 11 September 8, 2020 30
Android 12 12-12.1 October 4, 2021 31-32
Android 13 13 August 15, 2022 33
Android Setup Environment
you can start your Android application development on either
Mac OS X 10.5.8 or later version with Intel chip.
Microsoft Windows XP or later version.
Linux including GNU C Library 2.7 or later.
Java JDK5 or later version
You can download the latest version of Java JDK from Oracle's Java site
Java SE Downloads.
You will find instructions for installing JDK in downloaded files, follow the given
instructions to install and configure the setup.
Finally set PATH and JAVA_HOME environment variable to refer to the directory
that contains java and javac.
Android Studio
You can download the latest version of Android Studio from Developer’s site.
Android SDK
Android SDK stands for Android Software Development Kit which
is developed by Google for Android Platform.
Android SDK is a collection of libraries and Software Development
tools that are essential for Developing Android Applications.
It is compatible with all operating systems such as Windows, Linux,
macOS, etc.
Android SDK
Components of Android SDK
SDK Tools
Android SDK Tools
Android SDK Build-Tools
Android SDK Platform-tools
Android Emulator
SDK Platforms
SDK Update Sites
SDK Tools
Below are the SDK developer tools:
Android SDK Build tool
Android Emulator
Android SDK Platform-tools
Android SDK Tools
Android SDK Tools
It contains the complete set of Debugging and Development tools for
android.