0% found this document useful (0 votes)
66 views29 pages

Shri Alpesh N. Patel Postgraduate Institute of Science & Research

This document provides an introduction to the Android operating system, including: 1) An overview of Android's history and development, describing its origins at Android Inc. and acquisition by Google. 2) Descriptions of each major Android version from 1.0 to 4.3.1, noting new features and changes in each release. 3) Details on Android's standard development environment and tools for creating basic "Hello World" applications to run on emulators.

Uploaded by

Drivarswala
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)
66 views29 pages

Shri Alpesh N. Patel Postgraduate Institute of Science & Research

This document provides an introduction to the Android operating system, including: 1) An overview of Android's history and development, describing its origins at Android Inc. and acquisition by Google. 2) Descriptions of each major Android version from 1.0 to 4.3.1, noting new features and changes in each release. 3) Details on Android's standard development environment and tools for creating basic "Hello World" applications to run on emulators.

Uploaded by

Drivarswala
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/ 29

PS03CINT31 || Unit 01

Shri Alpesh N. Patel Postgraduate Institute of


Science & Research
Department of Information Technology
M.Sc. Information Technology
Semester-3

PS03CINT32 || Mobile Application Development


Unit 01 || Introduction to Android

• Introduction to Android
• Standard development environment for Android applications
• Installing Android
• Introduction to Android Studio
• Creating Hello World and running application on Emulator
• Android Architectural Overview and Android Development
Framework
• Structure of Android application
• Components of Android

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 1


PS03CINT31 || Unit 01

Introduction to Android:
• The world is contracting with the growth of mobile phone technology.
• As the number of users is increasing day by day, facilities are also
increasing.
• Starting with simple regular handsets which were used just for making
phone calls, mobiles have changed our lives and have become part of
it.
• Now they are not used just for making calls but they have innumerable
uses and can be used as a Camera, Music player, Tablet PC, T.V., Web
browser, etc. And with the new technologies, new software and
operating systems are required.

What is Android?
• Android is the world's most popular operating system for mobile devices
and tablets. It is an open-source operating system, created by Google,
and available to all kinds of developers with various expertise levels,
ranging from rookie to professional.
• One of the most widely used mobile OS these days is ANDROID.
Android Inc was founded in Palo Alto of California, the U.S. by Andy
Rubin, Rich miner, Nick Sears, and Chris White in 2003. Later Android
Inc. was acquired by Google in 2005. After the original release, there
have been several updates in the original version of Android.
• From a developer's perspective, Android is a Linux-based operating
system for smartphones and tablets. It includes a touch screen user
interface, widgets, camera, network data monitoring, and all the other
features that enable a cell phone to be called a smartphone.
• Android is a platform that supports various applications, available
through the Android Play Store.
• The Android platform also allows end-users to develop, install and use
their applications on top of the Android framework. The Android
framework is licensed under the Apache License, with Android

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 2


PS03CINT31 || Unit 01

• application developers holding the right to distribute their applications


under their customized license.

Code name Version numbers API level Release date

Alpha 1.0 1 September 23, 2008

Beta 1.1 2 February 9, 2009

Cupcake 1.5 3 April 27, 2009

Donut 1.6 4 September 15, 2009

Eclair 2.0 - 2.1 5-7 October 26, 2009

Froyo 2.2 - 2.2.3 8 May 20, 2010

Gingerbread 2.3 - 2.3.7 9 - 10 December 6, 2010

Honeycomb 3.0 - 3.2.6 11 - 13 February 22, 2011

Ice Cream Sandwich 4.0 - 4.0.4 14 - 15 October 18, 2011

Jelly Bean 4.1 - 4.3.1 16 - 18 July 9, 2012

KitKat 4.4 - 4.4.4 19 - 20 October 31, 2013

Lollipop 5.0 - 5.1.1 21- 22 November 12, 2014

Marshmallow 6.0 - 6.0.1 23 October 5, 2015

Nougat 7.0 24 August 22, 2016

Nougat 7.1.0 - 7.1.2 25 October 4, 2016

Oreo 8.0 26 August 21, 2017

Oreo 8.1 27 December 5, 2017

Pie 9.0 28 August 6, 2018

Android 10 10.0 29 September 3, 2019

Android 11 11 30 September 8, 2020

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 3


PS03CINT31 || Unit 01

Android Version 1.0 to 1.1: No codename


• Android officially publish its Android version 1.0 in September 2008.
• It is the initial version of Android operating system.
• It supports Web browser to show HTML and XHTML web pages,
camera, access web email server (POP3, IMAP4, and SMTP). This
version contains Google Calendar, Google Maps, Google Sync, Google
Search, Google Talk, Instant messaging, Media player, Notifications
appear in the status bar, wallpaper, YouTube video player, Alarm Clock,
Calculator, Dialer, Pictures, Wi-Fi and Bluetooth support.

Android version 1.5: Cupcake


• On April 27, 2009, the Android updated to 1.5 with the codename of
the dessert item (Cupcake).
• It has Linux kernel 2.6.27.
• It supports third-party virtual keyboard, Video recording and playback
in MPEG-4, Copy and paste feature, Animated screen translations,
auto-rotation option, ability to upload a video to YouTube, upload
photos to Picasa, check phone usage history.

Android version 1.6: Donut


• On September 15, 2009, Android 1.6 was released with the name
Donut.
• It contains numerous new features such as voice and text entry search,
bookmark history, contacts, web, "speak" a string of text, faster camera
access, user can select multiple photos for deletion, support text-to-
speech engine, WVGA screen resolutions.

Android version 2.0 to 2.1: Eclair


• On October 26, 2009, Android 2.0 was released, whose codename was
Eclair.
• It was based on Linux kernel 2.6.29.
• It contains the several new features as expanded account sync,
Microsoft Exchange email support, Bluetooth 2.1, ability to tap a

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 4


PS03CINT31 || Unit 01

Contact photo and select to call, SMS, ability to search all saved
SMS, MMS messages, delete the oldest message automatically when
the defined limit is reached, Minor API, bug fixes.

Android version 2.2 to 2.2.3: Froyo


• On May 20, 2010, Android 2.2 (Froyo) was released based on Linux
kernel 2.6.32.
• It contains several features as speed, memory, performance
optimization.
• JIT compilation, Integration of Chrome's V8, JavaScript engine into the
Browser application, support Android Cloud to Device Messaging
service, Adobe Flash support, security updates, and performance
improvement.

Android version 2.3 to 2.3.7: Gingerbread


• On December 6, 2010, the Android 2.3 (Gingerbread) was released
based on Linux kernel 2.6.35.
• It includes the following changes: support for extra-large screen size
and resolutions, updated user interface design with increased
simplicity and speed, enhanced copy/paste functionality, select a word
by press-holding, support Near Field Communication (NFC),
headphone virtualization, new Download Manager.
• It has improved bug fixes for Nexus S, voice or video chat using Google
Talk, network performance for Nexus S 4G, Gmail application, battery
efficiency, fixed a voice search bug, Google Wallet support for Nexus S
4G.

Android version 3.0 to 3.2.6: Honeycomb


• On February 22, 2011, Android 3.0 (Honeycomb) was launched for the
first tablet for Android-based on Linux kernel 2.6.36. It contains the
features like "holographic" user interface for tablet, added system Bar,
simplified multitasking tapping Recent Application in system Bar,
redesign the keyboard making fast typing, quick access to camera
exposure, hardware acceleration, support for multi-core processor, UI

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 5


PS03CINT31 || Unit 01

refinements, connectivity for USB accessories, support for joysticks and


gamepads, high-performance Wi-Fi lock, improved hardware support,
Google Books, fixed data connectivity issues when coming out of
Airplane mode.

Android version 4.0 to 4.0.4: Ice Cream Sandwich


• On October 19, 2011, Android 4.0.1 (Ice Cream Sandwich) was
launched, which was based on Linux kernel 3.0.1. It was the last
version of officially support Adobe System Flash player. It introduces
the numerous new features: refinements to "Holo" interface with new
Roboto font family, separation of widgets in a new tab, integrated
screenshot capture, improved error correction on the keyboard,
improved copy and paste functionality, build-in photo editor, fixed
minor bugs, improvement to graphics, spell-checking, better camera
performance.

Android version 4.1 to 4.3.1: Jelly Bean


• On June 27, 2012, Google announced Android 4.1(Jelly Bean) in the
Google I/O conference. It is based on Linux kernel 3.0.31. It updates to
following features: smoother user interface, enhance accessibility,
expandable notification, fixed bug on Nexus 7, one-finger gestures to
expand/collapse notifications, lock screen improvement, multiple user
accounts (tablets only), new clock application, Bluetooth low energy
support, volume for incoming call, 4K resolution support, native emoji
support, bug fixes for the Nexus 7 LTE.

Android version 4.4 to 4.4.4: KitKat


• On September 3, 2013, Google announced Android 4.4 (KitKat).
Initially, its code name was "Key Lime Pie". Google started on Google's
Nexus 5 on October 31, 2013. The minimum required amount of RAM
should available to Android is 340 MB. The other devices with less than
512 MB of RAM must report themselves as "low RAM" devices. It
includes several new features as clock no longer display bold hours,
wireless printing capability, WebViews are based on Chromium engine,

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 6


PS03CINT31 || Unit 01

sensor batching, built-in screen recording feature, better application


compatibility, camera application loads Google+ Photo instead of
Gallery.

Android version 5.0 to 5.1.1: Lollipop


• Android 5.0 "Lollipop" was initially named "Android L" on June 25,
2014. It was officially introduced on November 12, 2014. Lollipop
provides several features like redesigned user interface, support for 64-
bit CPUs, support for print previews, material design, Project Volta for
battery life improvement, multiple user accounts, audio input, and
output through USB devices, join Wi-Fi networks, support for multiple
SIM cards, device protection, high-definition voice calls, native Wi-Fi
calling support.

Android version 6.0 - 6.0.1: Marshmallow


• Android 6.0 "Marshmallow" was disclosed under the codename
"Android M" on May 28, 2015, for Nexus 5 and Nexus 6 phones, Nexus
9 tablet.
• On October 5, 2015, Android lunches "Marshmallow" for all android
devices. It contains the various new features as App Standby feature,
introduce the Doze mode to save battery life, native fingerprint reader
support, run-time permission requests, USB-C support, Unicode 7.0 &
8.0 emoji support.

Android version 7.0 to 7.1.2: Nougat


• Android 7.0 "Nougat" was the major release for the Android operating
system. Its initial codename was "Android N". It was first released as a
developer preview on March 9, 2016, with factory images for the Nexus
device.
• On August 22, 2016, the final preview built was released with following
features: file-based encryption, zoom in the screen, multi-window
support, new Data Saver mode, JIT compiler makes 75 percent faster
app installation, picture-in-picture support, support manager APIs,

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 7


PS03CINT31 || Unit 01

circular app icons support, send GIFs directly from the default
keyboard, battery

Android version 8.0 to 8.1: Oreo


• Android 8.0 "Oreo" was the 8th major release of the Android operating
system. It was first released for developer preview on March 21, 2017.
The final developer preview was released on July 24, 2017.
• On August 21, 2017, its stable version was released with several
features: picture-in-picture support, support for Unicode 10.0 emoji
(5.0), restructured settings, adoptive icons, notification channels,
notification dots, 2 times faster boot time, Google Play Protect,
Integrated printing support, Neural network API, shared memory API,
Android Oreo Go Edition, autofill framework, automatic light, and dark
themes.

Android version 9.0: Pie


• Android 9.0 "Pie" was the ninth major version of the Android operating
system. It was first announced and preview launched by Google on
March 7, 2018. It was officially released on August 6, 2018. It has the
following features: the clock has moved to the left of the notification bar,
the "screenshot" button has been added, battery percentage always
shown on display.

Android version 10:


• Android 10 is the tenth extensive version of the Android operating
system. Android 10 has developed under the codename "Android Q". It
was initially announced by Google on March 13, 2019 and its first beta
version was released on same day and its second beta was released on
April 3, 2019.
• The stable version of Android 10 was released on September 3, 2019. It
contains features like new permissions to access location in the
background, floating setting panel, support for an AV1 video codec,
support for biometric authentication, support the WPA3 Wi-Fi security.

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 8


PS03CINT31 || Unit 01

Android 11
• Android 11 operating system is the eleventh big release of Android. It is
the 18th version of Android mobile OS, which was released on 8
September 2020. The alphabetic naming system of Android, based on
deserts, was stopped since Android 10. So therefore, this operating
system has branded with "Android 11".

Features included in Android 11


o Conversations: Get all your message in one place.
o Accessibility: Perceptive apps help us to control and navigate our
phone using voice command.
o Device controls: Android 11 allows us to control all our connected
devices (IOT) from a single point.
o Content capture: Android 11 comes with a screen recording feature
that captures our phone's current screen activity.
o Predictive tools: By predicting our habits and patterns of working, it
suggests accordingly.
o Privacy & security: Android 11 gives more security and privacy fixes
to our smartphone straight from Google Play.
o Media: We can play music from other devices connected to our phones.

History of Android:
• The Motorola DynaTAC800X was the first commercially available
portable cell phone.
• First Marketed in 1983, it was 13 * 1.75 * 3.5 inches in dimension.
• Weighted about 2.5 pounds (1.134 kg)
• It allowed you to talk for a little more than half an hour.
• The price for it is $3,995/- + Monthly service fees + per-minute
charge.
• The first clamshell phone, the Motorola StarTAC was released in
1996.
• It merely had an LCD ten-digit segmented display.

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 9


PS03CINT31 || Unit 01

• The first shipping Android Handset the T-Mobile G1 was developed


by a handset manufacture with HTC service provided by T-Mobile.
• It was released on October 22, 2008.

Hidden Facts about Android:


Android Version Naming:
• A, B, C, D, E, F, G, H, I, J, K, L, M, N, O ,.............. What is this? Well,
this is the order in which most of the Android versions are named so
far.
• “Sweet” Naming Convention
• Based on Linux Kernel
• HTC (HTC G1 or T-Mobile G1) made the first-ever Android device.
• Google did not start Android. (Andy Rubin – The Man Behind Android)
• Free and Open Source
• So far, the most used Smartphone OS
• Android Rivals – Apple’s iOS and Windows Phone
• Free development tools with Enormous Support
• Android almost had 50% of the total market share in Q4 of 2011.
• Google gives Android free of cost to cell phone manufacturers.
• Android Logo Facts: Google Android logo derived from the Atari Game
called “Gauntlet: The Third Encounter”. Or at least it seems so,
looking at this comparison picture.

Standard Development Environment for Android Application:


• Android software development is the process by which new applications
are created for the Android Operating System. Applications are usually
developed in the Java Programming language using the Android
Software Development Kit.

Android SDK:

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 10


PS03CINT31 || Unit 01

• The Android software development kit (SDK) includes a comprehensive


set of development tools. These include a debugger, libraries, a handset
emulator based on QEMU, documentation, sample code, and tutorials.
• Currently supported development platforms include computers
running Linux, Mac OS X 10.5.8 or later, Windows XP or later, for the
moment one can develop Android software on Android itself by using
the app.
• Additionally, developers may use any text editor to edit Java and XML
files, then use command-line tools to create, build and debug Android
applications as well as control attached Android devices.

Installing Android:
To begin with android apps development, we need to install the SDK and some
other required components. Following are the steps one may follow to have
the Android SDK.

Step 1: Install the JDK


Android requires the JDK “Java Development Kit” to compile Java
Programs. The JDK is available on Oracle’s Java webpage.

Step 2: Install Your IDE of Choice:


Android Studio is recommended as it is the IDE that the Android developers
use and the IDE with official plug-in support from Google.

Step 3: Create an Android Virtual Device (AVD):


To create an AVD, we can open the Android AVD manager from the Tools
menu, and go to “AVD Manager”. From there, we can add, configure and delete
them:

Note: Creating AVDs is a great way to see how our application might work
across different operating systems and handset types, as AVDs can mimic not
only different Android Operating Systems but also different hardware; we can
change such settings as heap size, display type, and maximum memory,

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 11


PS03CINT31 || Unit 01

making it useful to try and figure out where bugs are happening when we
don’t own a multitude of different handsets to test on!

Creating Hello world and running application on Emulator:

Step 1: Start → Type Android Studio

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 12


PS03CINT31 || Unit 01

Step 2: Click on Create New Project

Step 3: Select “Phone and Tablet” from Template and Select


“Empty Activity” and Click on Next

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 13


PS03CINT31 || Unit 01

Step 4: Enter Project Name, and Save Location.

Select Language and Select

Min. SDK and click on Next.

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 14


PS03CINT31 || Unit 01

How to Run Android Application:

Step 1 → Click on “AVD Manager” from Tools Menu.

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 15


PS03CINT31 || Unit 01

Step 2 → Click on “Create Virtual Device”

Step 3 → Select Category and Choose a device definition.

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 16


PS03CINT31 || Unit 01

Step 4 →Enter AVD Name.

Step 5 → Select System Image.

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 17


PS03CINT31 || Unit 01

Android Studio
• Android Studio is the official Integrated Development Environment
(IDE) for android application development.
• Android Studio provides more features that enhance our productivity
while building Android apps.
• Android Studio was announced on 16th May 2013 at the Google I/O
conference as an official IDE for Android app development.
• It started its early access preview from version 0.1 in May 2013. The
first stable built version was released in December 2014, starts from
version 1.0.
• Since 7th May 2019, Kotlin is Google's preferred language for Android
application development. Besides this, other programming languages
are supported by Android Studio.
Features of Android Studio:
• It has a flexible Gradle-based build system.
• It has a fast and feature-rich emulator for app testing.
• Android Studio has a consolidated environment where we can develop
for all Android devices.
• Apply changes to the resource code of our running app without
restarting the app.
• It provides build-in supports for the Google Cloud Platform. It makes it
easy to integrate Google Cloud Messaging and App Engine.

Android Studio Version History


Version Release date Version Release date
1.0 December 2014 2.2 September 2016
1.1 February 2015 2.3 March 2017
1.2 April 2015 3.0 October 2017
1.3 July 2015 3.1 March 2018
1.4 September 2015 3.2 September 2018
1.5 November 2015 3.3 January 2019
2.0 April 2016 3.4 April 2019
2.1 April 2016 3.5 August 2019

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 18


PS03CINT31 || Unit 01

Android Studio User Interface


The Android Studio main window contains several logical areas which are
shown in the below figure:

1. The toolbar provides us a wide range of actions, which includes


running apps and launching Android tools.
2. The navigation bar helps in navigating our project and opens files for
editing. It gives a compact view of the structure visible in the Project
window.
3. The editor window is a space where we can create and modify our code.
Based on the current file type, the editor can change. While viewing a
layout file, the editor displays the Layout Editor.
4. The tool window bar runs around the outside of the IDE window and
contains buttons that allow us to expand and collapse individual tool
windows.
5. The tool windows provide us access to specific tasks like search,
project management, version control, and more. We can able expand
and collapse them.
6. The status bar displays the status of our project and IDE itself, as well
as any messages or warnings.

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 19


PS03CINT31 || Unit 01

Android Studio Tool window


The below table provides the list of shortcuts for the most common windows.
Tool window Windows and Linux Mac
Project Alt + 1 Command + 1
Version Control Alt + 9 Command + 9
Run Shift + F10 Control + R
Debug Shift + F9 Control + D
Logcat Alt + 6 Command + 6
Return to Editor Esc Esc
Hide all Tool Windows Control + Shift + F12 Command + Shift + F12

Gradle build system


Gradle build used as the foundation of the build system in Android Studio. It
uses more Android-specific capabilities provided by the Android plugin for
Gradle. This build system runs independently from the command line and
integrated tool from the Android Studio menu. We can use build features for
the following purpose:
o Configure, customize, and extend the build process.
o We can create multiple APKs from our app, with different features using
the same project and modules.
o Reuse resources and code across source sets.

How to make android apps


We are creating a simple example of android using the Android Studio IDE.
For creating the simple example:
1. Create the new android project
2. Write the message (optional)
3. Run the android application

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 20


PS03CINT31 || Unit 01

Android Architectural Overview & Android Development


Framework:
The android operating system is a stack of software components that is
roughly divided into five sections and four main layers as shown below in the
architecture diagram.

Linux kernel:
At the bottom of the layers is Linux - Linux 2.6 with approximately 115
patches. This provides basic system functionality like process management,
memory management, device management 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.

Libraries:
On top of the 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

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 21


PS03CINT31 || Unit 01

play and record audio and video, SSL libraries responsible for Internet
security, etc.

Android Runtime:
This is the third section of the architecture and available on the second layer
from the bottom. This section provides a key component called Dalvik Virtual
Machine (DVM) which is a kind of Java Virtual Machine (JVM) specially
designed and optimized for Android. The Dalvik VM enables every Android
application to run in its process, with its instance of the Dalvik virtual
machine.

The Android runtime also provides a set of core libraries that enable Android
application developers to write Android applications using standard Java
programming language.

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.

Applications:
We will find all the Android applications at the top layer. We will write our
application to be installed on this layer only. Examples of such applications
are Contacts Books, Browser, Games, etc.

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 22


PS03CINT31 || Unit 01

Hello Android Example


Create the New Android project
For creating the new android studio project:
Step 1 → Select Start a new Android Studio project

Step 2 → Provide the following information: Application name, Company


domain, Project location, and Package name of the application and click
next.

Step 3 → Select the API level of application and click next.

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 23


PS03CINT31 || Unit 01

Step 4 → Select the Activity type (Empty Activity).

Step 5 → Provide the Activity Name and click finish.

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 24


PS03CINT31 || Unit 01

After finishing the Activity configuration, Android Studio auto-generates the


activity class and other required configuration files. Now an android project
has been created. You can explore the android project and see the simple
program; it looks like this:

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 25


PS03CINT31 || Unit 01

Write the message


File: activity_main.xml
Android studio auto generates code for activity_main.xml file.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http:/
/schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="first.javatpoint.com.welcome.MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello Android!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>

File: MainActivity.java
package first.javatpoint.com.welcome;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 26


PS03CINT31 || Unit 01

Run the android application:


To run the android application, click the run icon on the toolbar or press Shift
+ F10.

After booting the emulator, the android studio installs the application and
launches the activity.

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 27


PS03CINT31 || Unit 01

Android Studio Project Structure:


The Android Studio project contains one or more modules with resource files
and source code files. These include different types of modules-
• Android app modules
• Library modules
• Google App Engine modules
• By default, Android Studio
displays our project files in the
Android project view, as shown
in the above image.
• This view is formed by modules
to provide quick access to our
project's key source files.
• These build files are visible to
the top-level under Gradle
Scripts. And the app module
contains the following folders:
o manifests: It contains the
AndroidManifest.xml file.
o java: It contains the source code
of Java files, including the JUnit
test code.
o res: It contains all non-code
resources, UI strings, XML
layouts, and bitmap images.

Components of Android:

Activity: It represents the presentation layer of an Android application. It


presents a screen in your application. Activity can be displayed as dialogues
or can be Transparent. An Android application can have several activities.

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 28


PS03CINT31 || Unit 01

Views and View Groups: “Views” are user interface widgets. The base class
for all the views is android. A “View Group” is for arranging other views. They
are also called layout managers the base class for “view Groups”

Intents: These are asynchronous message which allows the application to


request functionality from other components of the Android Systems.
Applications register themselves to intent via an Intents filter. To perform
certain tasks Intents, allow combining loosely coupled Components.

Services: Services that perform background tasks without providing a user


Interface can notify the user via the notification framework in Android.

Content Provider: It provides a structured interface to application data via a


content provider application can share data from one to another. Along with
content provider SQLite database is used in conjunction. The SQLite database
stores the data which is accessed by the content provider.

Broadcast Receiver: Broadcast receiver registers the messages and Intents


In the case when a specified situation happens a Broadcast receiver will get
notified by the Android system.

Widgets (Home Screen): These are interactive components used on the


Android home screen. They display a kind of data and allow the user to
perform via then.

Shri Alpesh N. Patel Postgraduate Institute of Science & Research Page 29

You might also like