And
And
Olympia Campus
Department of Computer Science
Course Title: Mobile Application
Development
Chapter 1
Introduction to Android
7/16/2023 1
What is Android?
7/16/2023 3
Why use Android?
Android provides an extensive developer's community
support.
It uses the core Java language for developing
applications.
It also provides high marketing.
Application development cost is less.
Good storage and uses a lightweight relational database,
SQLite
It provides good security.
7/16/2023 4
History of Android
7/16/2023 5
Features of Android
Android is a powerful open-source operating system
that open-source provides immense features and some
of these are listed below.
7/16/2023 6
Features of Android Con…
Android Open Source Project so we can customize the OS
based on our requirements.
Android supports different types of connectivity for GSM,
CDMA, Wi-Fi, Bluetooth, etc. for telephonic conversation
or data transfer.
Using wifi technology we can pair with other devices while
playing games or using other applications.
It contains multiple APIs to support location-tracking
services such as GPS.
We can manage all data storage-related activities by using the
file manager.
7/16/2023 7
Features of Android Con…
It contains a wide range of media supports like AVI, MKV,
FLV, MPEG4, etc. to play or record a variety of audio/video.
It also supports different image formats like JPEG, PNG, GIF,
BMP, MP3, etc.
It supports multimedia hardware control to perform playback or
recording using a camera and microphone.
Android has an integrated open-source WebKit layout-based web
browser to support User Interfaces like HTML5, and CSS3.
Android supports multi-tasking means we can run multiple
applications at a time and can switch between them.
It provides support for virtual reality or 2D/3D Graphics.
7/16/2023 8
Structure of Android Application
It is very important to know about the basics of Android
Studio’s file structure.
7/16/2023 9
Structure of Android Application Con…
1. AndroidManifest.xml: Every project in Android includes a
manifest file, which is AndroidManifest.xml, stored in the root
directory of its project hierarchy.
The manifest file is an important part of our app because it
defines the structure and metadata of our application, its
components, and its requirements.
2. Java: The Java folder contains the Java source code files.
These files are used as a controller for controlled UI (Layout
file).
It gets the data from the Layout file and after processing
that data output will be shown in the UI layout.
It works on the backend of an Android application.
7/16/2023 10
Structure of Android Application Con…
3. Drawable: A Drawable folder contains resource type file
(something that can be drawn).
Drawables may take a variety of file like Bitmap (PNG,
JPEG), Nine Patch, Vector (XML), Shape, Layers,
States, Levels, and Scale.
4. layout: A layout defines the visual structure for a user
interface, such as the UI for an Android application.
This folder stores Layout files that are written in XML
language.
You can add additional layout objects or widgets as child
elements to gradually build a View hierarchy that defines
your layout file.
7/16/2023 11
Structure of Android Application Con…
5. Mipmap: Mipmap folder contains the Image Asset file
that can be used in Android Studio application.
You can generate the following icon types like
Launcher icons, Action bar and tab icons, and
Notification icons.
6. Colors.xml: colors.xml file contains color resources of
the Android application.
Different color values are identified by a unique name
that can be used in the Android application program.
7/16/2023 12
Cont’d
7. strings.xml: The strings.xml file contains string resources of the
Android application.
The different string value is identified by a unique name that can be
used in the Android application program.
This file also stores string array by using XML language.
7/16/2023 13
Cont’d
9. build.gradle(Module: app): This defines the
module-specific build configurations.
The Android build system compiles app
resources and source code, and packages them
into APKs or Android App Bundles that you
can test, deploy, sign, and distribute.
7/16/2023 14
Android UI architecture
7/16/2023 15
Android S/W Stack - Application
7/16/2023 16
Features of Android App Framework
Feature Role
7/16/2023 17
Android S/W Stack - Libraries
7/16/2023 18
Android S/W Stack - Runtime
Core Libraries
Providing most of the functionality available in the
core libraries of the Java language
APIs
Data Structures
Utilities
File Access
Network Access
Graphics
7/16/2023 19
Android S/W Stack – Runtime Con…
Dalvik Virtual Machine
Providing environment on which every Android application runs
Each Android application runs in its own process, with its own instance of the
Dalvik VM.
Dalvik has been written such that a device can run multiple VMs efficiently.
Register-based virtual machine
Dalvik Virtual Machine (Cont)
Executing the Dalvik Executable (.dex) format
.dex format is optimized for minimal memory footprint.
Compilation
Driver Model
Security
Providing an abstraction layer between the H/W and the rest of t
the S/W stack
7/16/2023 21
Android activity lifecycle UI architecture
7/16/2023 22
Android Activity Lifecycle methods
7 lifecycle methods of android activity.
7/16/2023 23
UI Components
Android UI Controls are those components of Android
that are used to design the UI in a more interactive way.
It helps us to develop an application that makes user
interaction better with the view components.
Android provides us a huge range of UI controls of
many types such as buttons, text views, etc.
7/16/2023 24
Cont’d
7/16/2023 25
Android UI Control Con…
TextView: is a UI Component that displays the text to the
user on their Display Screen.
There are various attributes to describe the TextView some
of them are named below:
Android: id – it is a unique id for the control.
Android: width – It displays the exact width of the TextView.
Android: height – It displays the exact height of the TextView.
Android:textColor – It set the color of the text.
Android: gravity – It is to align the TextView.
Edit Text
is a user interface control that allows the users to enter some text.
7/16/2023 26
Android UI Control Con…
Button: is a UI that is used to perform some action as
soon as the user clicks on it.
ImageButton: It is the same as a Button but it’s used
to display an image on the button to perform an
Action.
In this, we need to give the source of the image so that the
system can load it.
ToggleButton
The toggle button displays the ON/OFF states of a button
with a light indicator.
7/16/2023 27
Android UI Control Con…
RadioButton
Radio button in Android is the one that has only two possible
states, that are either checked or unchecked.
Initially, it is in the unchecked state, once it’s checked it can’t be
unchecked.
RadioGroup
It’s a group of Radio buttons that are alike.
In this, only one of all the buttons can be chosen.
CheckBox
A CheckBox is the UI control that has two states that are either
checked or unchecked.
If we have a group of CheckBox, we can select as many as we
want, unlike RadioGroup.
7/16/2023 28
Android UI Control Con…
ProgressBar
In Android, we have a progress bar that shows the progress of
some action that is happening like pasting a file to some location.
A progress bar can be in two modes:
Determinate Mode:
In this, the progress is shown with the percent of action
completed. Also, the time to be taken is already determined.
Indeterminate Mode:
Inthis, there is no idea of when the task would be
completed, therefore, it functions continuously.
Spinner, TimePicker, DatePicker, SeekBar, RatingBar, AlertDialog,
Switch, AutoCompleteTextView.
7/16/2023 29
7/16/2023 30