0% found this document useful (0 votes)
5 views

Unit-1

The document provides an overview of the Android operating system, its history, and the development tools associated with it, including the Android SDK and command-line tools. It details the architecture of Android, the role of the Open Handset Alliance, and the evolution of mobile applications from early devices to modern smartphones. Additionally, it discusses the importance of context in Android programming, outlining the types of context available for application development.

Uploaded by

maniac.ltd73
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Unit-1

The document provides an overview of the Android operating system, its history, and the development tools associated with it, including the Android SDK and command-line tools. It details the architecture of Android, the role of the Open Handset Alliance, and the evolution of mobile applications from early devices to modern smartphones. Additionally, it discusses the importance of context in Android programming, outlining the types of context available for application development.

Uploaded by

maniac.ltd73
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Unit-1 Introduction of Android

1) Android Operating System, History of Mobile Software Development


2) Open Handset Alliance (OHA)
3) The Android Platform, Android SDK, Command-Line Tools and the Android Emulator,
Application Context, Application Tasks, Installation

2.1.1 Android Operating System

➔ Android is an operating system developed by Google for mobile systems. It is based on the
Linux kernel and mainly designed for touchscreen devices such as tablets and smartphones.
➔ Mobile Computing is a technology that allows transmission of data, voice and video via
wireless enabled device without having to be connected to a fixed physical link
➔ Andy Rubin has been credited as the father of the Android platform.
➔ His company, Android Inc., was acquired by Google in 2005.
➔ Android platform development is completed by Rubin’s team at Google.
➔ Android is an Operating System
➔ It is not a hardware platform
➔ Android includes a Linux kernel-based OS
➔ Android OS are written in C or C++
➔ We can develop User applications using JAVA.
➔ It is called as APK (Android Application Package).
➔ Android is released under two different open source licenses.
➔ The Linux kernel is released under the GPL (GNU General Public License), as is required for
anyone licensing the open source OS kernel.
➔ The Android platform, excluding the kernel, is licensed under the Apache Software License
(ASL).
➔ While both licensing models are open source–oriented.
➔ To write Android application – we need…
• JDK 6.0 or higher.
JDK Stands for Java Development Kit
• JAVA IDE such as Eclipse or Android Studio.
IDE stands for Integrated Development Environment
• Android SDK.
SDK stands for Software Development Kit
• Android Development Tools.
➔ Let's See Android versions...
➔ Architecture of Android
-

- Applications:
You will find applications that ship with the Android device (such as Phone, Contacts,
Browser, etc.), as well as applications that you download and install from the
Android Market.
- Application Framework:
The Application Framework layer provides many higher-level services to applications
in the form of Java classes. Application developers are allowed to make use of these
services in their applications.
The Android 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
- 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 of application data, libraries to play and record audio and
video, SSL libraries responsible for Internet security etc.
- Android Libraries:
This category encompasses those Java-based libraries that are specific to Android
development. Examples of libraries in this category include the application
framework libraries in addition to those that facilitate user interface building,
graphics drawing and database access. A summary of some key 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.
- Android Runtime:
▪ Android runtime provides a set of core libraries that enable developers to write
Android apps using the Java programming language.
▪ The Android runtime also includes the Dalvik virtual machine, which enables every
Android application to run in its own process, with its own instance of the Dalvik
virtual machine.
▪ Dalvik is a specialized virtual machine designed specifically for Android and
optimized for battery-powered mobile devices with limited memory and CPU
- Linux Kernel:
▪ This is the kernel on which Android is based. This layer contains all the low-level
device drivers for the various hardware components of an Android device. ▪ At the
bottom of the layers is Linux - 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
all the things that Linux is really good at such as networking and a vast array of
device drivers, which take the pain out of interfacing to peripheral hardware.
History of Mobile Software Development

What is a Mobile Application?


A mobile application (or mobile app) is a software application designed to run
on smartphones, tablet computers and other mobile devices.

The history of the mobile app begins, obviously, with the history of the mobile device and
the first mobile phones whose microchips required the most basic of software to send and
receive voice calls. But since then, things have got a lot more complicated.

Where did it all begin?


The first public cellular phone call was made by Martin Cooper of Motorola on 3rd April
1973 in a publicity stunt in New York. There would be another ten years of R&D however
before the first cell phone would hit the market. The DynaTAC 8000X weighed in at around 2
pounds, cost $4,000 and didn’t run any apps.

Psion EPOC

The first recognisable apps came with Psion’s range of handheld computers – mostly PDAs –
that used the EPOC operating system. First released in the early 90s the sixteen-bit
machines (SIBO) which ran EPOC allowed users programmes such as a word processor,
database, spreadsheet and diary. Later models in the range, running a 32-bit OS, would
come with up to 2MB RAM and allow users to add additional apps via software packs (or via
download if you were lucky enough to own a modem).

EPOC, which was programmed in OPL (Open Programming Language) and allowed users to
create their own apps, would later form the backbone of the Symbian operating system.
Palm OS

Palm emerged as a major rival to Psion in the PDA market with its cheaper, lower
functionality range of PDAs – the Palm Pilot. Commercial success allowed Palm to release a
new generation of machines in 1996 which utilised the Palm OS. This had a touchscreen GUI
and came with a raft of basic apps as well as tons of third-party apps programmed in C/C++.
From Palm OS 3.0 onwards these included a WAP browser.

Following the acquisition of PalmSource by ACCESS, Palm OS became the ACCESS Linux
Platform before being abandoned in favour of webOS (which is now used in LG’s smart TVs).

Symbian

As mentioned earlier, Symbian grew out of the Psion EPOC operating system. Originally
developed by Symbian Ltd – a joint venture of Psion, Ericsson, Motorola and Nokia – the
operating system was almost ubiquitous. In 2009 250 million devices were running Symbian.

It was Nokia that really drove the development of Symbian OS. The S60 platform was used
on nearly all Nokia handsets as well as some Samsung and LG ones. The use of different,
fragmented platforms (Sony Ericsson and Motorola used UIQ and there was MOAP(S) for
NTT DoCoMo), each with its own API, meant that there were a variety of deployment
techniques and no standard market place for apps.

The incompatibility of apps across platforms and the failure to fully move to open source
(several key components were licensed from third parties) are probably what sounded the
death-knell for Symbian. There were also problems with malware, a browser which didn’t
support multiple windows or compress pages and a nightmare process for typing in non-
Latin text.

A market share of 37.6% in 2010 had dropped to 4.4% in 2012 after Nokia jumped ship for
the Windows Phone platform and other OEMs gathered beneath the banner of Android
with its single, unified market place for apps.

The last Symbian smartphone, the Nokia 808 PureView ran the Nokia Belle update which
used C++. It was an award-winning phone (chiefly because of its 41-megapixel camera) but
wasn’t enough to prolong Nokia’s heyday.

Open Handset Alliance (OHA)


What does Open Handset Alliance (OHA) mean?
The Open Handset Alliance (OHA) is a business alliance that was created for the purpose of
developing open mobile device standards. The OHA has approximately 80 member
companies, including HTC, Dell, Intel, Motorola, Qualcomm and Google. The OHA's main
product is the Android platform - the world's most popular smartphone platform.

OHA members are primarily mobile operators, handset manufacturers, software


development firms, semiconductor companies and commercialization companies. Members
share a commitment to expanding the commercial viability of open platform development.

OHA member companies back the open platform concept for a number of reasons, as
follows:

 Lower overall handset costs: Opens up resources, which facilitates the focus on
creating innovative applications, solutions and services.
 Developer-friendly environment: In the open-source community, developers share
notes to expedite application development.
 Post-development: Provides an ideal channel for application marketing and
distribution.
The Android Platform
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.

The Android Platform was launched in 2007 by the Open Handset Alliance, an alliance of
prominent companies that includes Google, HTC, Motorola, Texas Instruments and others.
Although most of the applications that run on the Android Platform are written in Java,
there is no Java Virtual Machine. Instead, the Java classes are first compiled into what are
known as Dalvik Executables and run on the Dalvik Virtual Machine (DVM).

Android is an open development platform. However, it is not open in the sense that
everyone can contribute while a version is under development. This is all done behind
closed-doors at Google. Rather, the openness of Android starts when its source code is
released to the public after it is finalized. This means once it is released anyone interested
can take the code and alter it as they see fit.

To create an application for the platform, a developer requires the Android SDK, which
includes tools and APIs. To shorten development time, Android developers typically
integrate the SDK into graphical user IDEs (Integrated Development Environments).
Beginners can also make use of the App Inventor, an application for creating Android apps
that can be accessed online.

Android SDK
The Android SDK (Software Development Kit) is a set of development tools used to develop
applications for the Android platform that has become Apple’s biggest rival in the
smartphone space. The Android SDK includes the following:

 Required libraries.
 Debugger.
 An emulator.
 Relevant documentation for the Android Application Program Interfaces (APIs).
 Sample source code.

Every time Google releases a new version of Android, a corresponding SDK is also released.
To be able to write programs with the latest features, developers must download and install
each version’s SDK for the particular phone. The SDK essentially represents Android’s
delivered toolkit for a specific version and technology of its operating systems.

The development platforms that are compatible with SDK include operating systems like
Windows (XP or later), Linux (any recent Linux distribution) and Mac OS X (10.4.9 or later).
The components of Android SDK can be downloaded separately. Third-party add-ons are
also available for download.
Although the SDK can be used to write Android programs in the command prompt, the most
common method is by using an integrated development environment (IDE). The
recommended IDE is Eclipse with the Android Development Tools (ADT) plug-in. However,
other IDEs, such as NetBeans or IntelliJ, will also work.

Most of these IDEs provide a graphical interface enabling developers to perform


development tasks faster. Since Android applications are written in Java code, a user should
have the Java Development Kit (JDK) installed.

Command Line Tools and the Android Emulator


The Android SDK is composed of multiple packages that are required for app development.
This page lists the most important command line tools that are available, organized by the
packages in which they're delivered.

You can install and update each package using Android Studio's SDK Manager or
the sdkmanager command line tool. All of the packages are downloaded into your Android
SDK directory, which you can locate as follows:

1. In Android Studio, click File > Project Structure.


2. Select SDK Location in the left pane. The path is shown under Android SDK location.

Located in: android_sdk/cmdline-tools/version/bin/

apkanalyzer

Provides insight into the composition of your APK after the build process completes.

avdmanager

Allows you to create and manage Android Virtual Devices (AVDs) from the command
line.

lint

A code scanning tool that can help you to identify and correct problems with the
structural quality of your code.

retrace

For applications compiled by R8, retrace decodes an obfuscated stack trace that
maps back to your original source code.

sdkmanager

Allows you to view, install, update, and uninstall packages for the Android SDK.
How to Install Android SDK Tools on Windows

https://android.tutorials24x7.com/blog/how-to-install-android-sdk-tools-on-windows

Android Emulator

The Android emulator is an Android Virtual Device (AVD), which represents a specific
Android device. We can use the Android emulator as a target device to execute and test our
Android application on our PC. The Android emulator provides almost all the functionality of
a real device. We can get the incoming phone calls and text messages. It also gives the location
of the device and simulates different network speeds. Android emulator simulates rotation
and other hardware sensors. It accesses the Google Play store, and much more

Testing Android applications on emulator are sometimes faster and easier than doing on a
real device. For example, we can transfer data faster to the emulator than to a real device
connected through USB.

The Android emulator comes with predefined configurations for several Android phones,
Wear OS, tablet, Android TV devices.

Requirement and recommendations

The Android emulator takes additional requirements beyond the basic system requirement
for Android Studio. These requirements are given below:

o SDK Tools 26.1.1 or higher


o 64-bit processor
o Windows: CPU with UG (unrestricted guest) support
o HAXM 6.2.1 or later (recommended HAXM 7.2.0 or later)

https://developer.android.com/studio/run/emulator

Application Context

Android apps are popular for a long time and it is evolving to a greater level as user’s
expectations are that they need to view the data that they want in an easier smoother view.
Hence, the android developers must know the important terminologies before developing
the app. In Android Programming we generally come across a word context. So what exactly
is this context and why is it so important? To answer this question lets first see what the literal
meaning of context is:

“The circumstances that form the setting for an event, statement, or idea, and in terms of
which it can be fully understood”

In android, context is the main important concept and the wrong usage of it leads to memory
leakage. Activity refers to an individual screen and Application refers to the whole app and
both extend the context class.

Types of Context in Android

There are mainly two types of context are available in Android.

o Application Context and


o Activity Context

The Overall view of the App hierarchy looks like the following:
o It can be seen in the above image that in “Sample Application”, nearest Context is
Application Context. In “Activity1” and “Activity2”, both Activity Context (Here it is
Activity1 Context for Activity1 and Activity2 Context for Activity2) and Application
Context. The nearest Context to both is their Activity Context only.

Application Context

o This context is tied to the life cycle of an application. Mainly it is an instance (object)
that is a singleton and can be accessed via getApplicationContext(). Some use cases
of Application Context are:

 If it is necessary to create a singleton object


 During the necessity of a library in an activity

o getApplicationContext():
o It is used to return the context which is linked to the Application which holds all
activities running inside it. When we call a method or a constructor, we often have to
pass a context and often we use “this” to pass the activity context
or “getApplicationContext” to pass the application context. This method is generally
used for the application level and can be used to refer to all the activities. For example,
if we want to access a variable throughout the android app, one has to use it
via getApplicationContext().
Application Tasks
A task is a collection of activities that users interact with when performing a certain job. The
activities are arranged in a stack—the back stack)—in the order in which each activity is
opened. For example, an email app might have one activity to show a list of new messages.
When the user selects a message, a new activity opens to view that message. This new activity
is added to the back stack. If the user presses the Back button, that new activity is finished
and popped off the stack. The following video provides a good overview of how the back stack
works.

When apps are running simultaneously in a multi-windowed environment, supported in


Android 7.0 (API level 24) and higher, the system manages tasks separately for each
window; each window may have multiple tasks. The same holds true for Android apps
running on Chromebooks: the system manages tasks, or groups of tasks, on a per-window
basis.

The device Home screen is the starting place for most tasks. When the user touches an icon
in the app launcher (or a shortcut on the Home screen), that app's task comes to the
foreground. If no task exists for the app (the app has not been used recently), then a new
task is created and the "main" activity for that app opens as the root activity in the stack.

When the current activity starts another, the new activity is pushed on the top of the stack
and takes focus. The previous activity remains in the stack, but is stopped. When an activity
stops, the system retains the current state of its user interface. When the user presses
the Back button, the current activity is popped from the top of the stack (the activity is
destroyed) and the previous activity resumes (the previous state of its UI is restored).
Activities in the stack are never rearranged, only pushed and popped from the s tack—pushed
onto the stack when started by the current activity and popped off when the user leaves it
using the Back button. As such, the back stack operates as a "last in, first out" object structure.
Figure 1 visualizes this behaviour with a timeline showing the progress between activities
along with the current back stack at each point in time.
Figure 1. A representation of how each new activity in a task adds an item to the back stack.
When the user presses the Back button, the current activity is destroyed and the previous
activity resumes.

If the user continues to press Back, then each activity in the stack is popped off to reveal the
previous one, until the user returns to the Home screen (or to whichever activity was
running when the task began). When all activities are removed from the stack, the task no
longer exists.
➔ Installation
- Step-1 :
Click on link https://developer.android.com/studio/#downloads to get the Android
Studio executable or zip file.
- Step-2 :
Click on the Download Android Studio Button.

Click on the “I have read and agree with the above terms and conditions”
checkbox followed by the download button.

Click on the Save file button in the appeared prompt box and the file will start
downloading.
- Step-3:
After the downloading has finished, open the file from downloads and run it. It will
prompt the following dialog box.

Click on next. In the next prompt, it’ll ask for a path for installation. Choose a path
and hit next.
- Step-4:
It will start the installation, and once it is completed, it will be like the image
shown below.

Click on Next
- Step-5:
Once “Finish” is clicked, it will ask whether the previous settings need to be
imported [if the android studio had been installed earlier], or not. It is better to
choose the ‘Don’t import Settings option’.

Click the OK button.


- Step-6:
This will start the Android Studio.

Meanwhile, it will be finding the available SDK components.


- Step-7 :
After it has found the SDK components, it will redirect to the Welcome dialog box.

Click on Next.

Choose Standard and click on Next. Now choose the theme, whether
the Light theme or the Dark one. The light one is called the IntelliJ theme whereas
the dark theme is called Dracula. Choose as required.
Click on the Next button.
- Step-8:
Now it is time to download the SDK components.

Click on Finish. Components begin to download let it complete.


The Android Studio has been successfully configured. Now it’s time to launch and
build apps. Click on the Finish button to launch it.
- Step-9:
Click on Start a new Android Studio project to build a new app.

You might also like