2. Outline
• What is Android?
• Introduction (The Android Stack)
• Android Architecture
• Application Components
• Android Development Process
2
3. What is Android?
• Android is a software stack for mobile devices
that includes an operating system,
middleware(Software that act as a bridge
between an operating system or database) and
key applications.
• Android is a mobile operating system that is
based on a modified version of Linux.
3
4. • Android is a comprehensive open source
platform designed for mobile devices.
• Comprehensive platform: complete
stack for mobile devices.
• Open source: the entire stacks are free to
• Google’s mobile platform
Runs Smartphone ,tablet computers , (Samsung
Tablets , Similar to iPad)
Most popular
• Development platform
Multiplatform
Based on Java
Plugins for Eclipse, Android Studio
4
cont.…
5. cont.…
• Android is an embedded OS(different kind of
machine or HW+SW)
• Android applications are written using
the Java framework, but Android is
not Java. Standard Java libraries such as
Swing are not supported.
• Android uses its own libraries.eg Time
Picker, global positioning.
• The Android OS is open source, which
means developers can view and use any
of the system source code
5
6. Android Features
• Storage: Uses SQLite, a lightweight relational database,
for data storage.
• Connectivity: Supports GSM/EDGE, IDEN, CDMA,
EV-DO, UMTS, Bluetooth (includes A2DP and AVRCP),
AVRCP), WiFi, LTE, and WiMAX.
• Messaging :Supports both SMS and MMS.
• Web browser: Based on the open-source WebKit,
together with Chrome’s V8 JavaScript engine
• Media support: includes support for the following
media: H.263, H.264 (in 3GP or MP4 container), MPEG-
MPEG-4 SP, AMR, AMR-WB (in 3GP container), AAC,
HE-AAC (in MP4 or 3GP container), MP3, MIDI, Ogg
Vorbis, WAV, JPEG, PNG, GIF, and BMP
6
7. cont.…
• Hardware support: Accelerometer
Sensor, Camera, Digital Compass,
Proximity Sensor, and GPS
• Multi-touch :Supports multi-touch
screens
• Multi-tasking: Supports multi-tasking
applications
• Flash support: Android 2.3 supports
Flash 10.1.
• Tethering: Supports sharing of Internet
connections as a wired/wireless hotspot
7
8. Android Stack
• Android operating system is like a cake
consisting of various layers. Each layer has its
own characteristics and purposes.
• Android is built on top of Linux.
• Way Linux?
– Its open source
– Portability-easy to integrate with different
hardware
– Security-Linux is highly secured system.
– Features-Linux provides:
• Hardware abstraction layer
• Memory management
• Process management
• Networking
8
9. …
• Software stack for mobile
devices
• Developed and managed
by open handset Alliances
• Open sourced under
Apache License
9
11. Android Architecture – Linux Kernel
• Android relies on Linux Kernel 2.6 for core system services
» Process management
» Network stack
» Driver model
» Security
• The Kernel acts as an abstrac5on layer between the hardware
and the rest of the software stack
12. Android Architecture -‐ Runtime
• Core Libraries
– Provides most of the functionality
available in the core libraries of the
Java programming language
– APIs
• Data Structures
• Utli5es
• File Access
• Network Access
• Graphics
• Etc
12
13. Android Architecture -‐ Runtime…
• Dalvik VM
– Every android application
runs in its own process with
its own instances of the
dalvik vm
– Dalvik VM has been writte
n so that a device can run
multiple VMs
efficiently
– Register‐based virtual machi
ne
13
14. Android Architecture -‐ Runtime…
• Executes files in the Dalvik Executable (.dex) format, which
is optimized for minimal memory footprint
• Runs classes compiled by a Java language compiler
transformed into the .dex format
•
Relies on the Linux kernel for underlying functionality such as threa
ding and low-‐level memory management
14
15. Android Architecture -‐ Runtime…
• Includes a set of C/C++
libraries used by various
components of the Androi
d
system
• Exposed to developers
through the Android
applica5on framework
15
• Features
• System C Library (Bionic) a
version of libc : for technology and
license purpose
• Media Libraries supporting playbac
k and recording of popular audio/vi
deo formats
• Surface Manager (Surface Flinger)
• Audio Manager (Audio Flinger)
• LibWebCore (WebKit)
• SGL
• 3D Libraries: Open GL ES
• WebKit browser support
• SQLite
16. Android Architecture -Application Frame work
• Enabling and simplifying the reuse of com
ponents
– Developers have full access to the same frame
work APIs used by the core applications.
– Application architecture designed to simplify re
use of components
– Users are allowed to replace components.
16
18. Android Architecture -Applications
• Android ships with a set of core applications:
– Email Client
– SMS Program
– Calendar
– Maps
– Browser
– Contacts
• All applications are written using the Java language
18
19. Most Popular Android Version September 2018
19
Old Version: Android 1.0, 1.1 to 1.5 (Cupcake), 1.6 (Donut), 2.0/2.1 (Eclair), 2.2
(Froyo), 2.3 (Gingerbread), to 3.0 (Honeycomb), 4.0 (Ice Cream Sandwich
20. Android Applications
• Android applications are written in Java
• The compiled Java code (along with any
data and resourcefiles required by the applicat
ion) is bundled into an Android package (.ap
k)
20
Runs in its own
Linux process
Each process has its own
virtual machine
Each application assigned
a unique Linux user Id
21. What is APK?
• An application is a single application package (APK) file.
An APK file roughly has three main components. An API
consists of the following major components:
• Dalvik executable
– This is all your Java source code compiled down to a Dalvik
executable.
– This is the code that runs your application.
• Resources
– Resources are everything that is not code. Your application may
contain a number of images and audio/video clips, as well
as numerous XML files describing layouts, language
packs, and so on. Collectively, these items are the
resources.
• Native libraries
– Optionally, your application may include some native code, such as 21
22. Android and Java
• Android Java
=
Java SE
–
AWT/Swing
+
Android API
22
Still
We
can
have
it
the
old
Classic
Way
(Procedural
)
But
This
is
a
better
approach(
separating
content
from
display)
23. Android and Java
• Android java is an nonstandard collection of java. way?
• java have different Editions (Java Packaging)
– Java ME (Mobile Edition)
– java SE(Standard Edition )
– Java EE(Enterprise Edition)
• but android is not part of these editions
• So why Java ::: market issue because tons of java coders in
the world
23
25. Activity
• An activity is usually a single screen that the
user sees on the device at one time.
undertake:
– Extends the Activity base class
– Displays user interface controls (views)
– Provides for user interaction
25
26. Service
• service runs in the background for an indefinite
period of time.
– Example: play music, network download, etc.
– Does not have a user interface
– extends the Service base class.
• We can bind to a running service (or start the service if it's
not already running)
26
27. Broadcast Receivers
• Receives and reacts to broadcast announcements (Intents)
– Many broadcasts originate in system code.
– E.g. announcements that a picture is taken, that the time z
one has changed, that the battery is low, etc.
– Applications can also initiate ate broadcasts.
• E.g. to let other applications know that some data has
been downloaded to the device and is available for the
m to use
• Do not have a user interface
• May start an activity in response to the received
broadcast.
• May also use notifications to alert the user.
27
28. Content Providers
• Makes a specific set of the applications
data available to other applications.
– Data can be stored in the file system, in an
SQLite, or in any other manner that makes sense
– extends the ContentProvider base class to implement a
standard set of methods that enable other applica5ons
to retrieve and store
data of the type it controls
• Applications do not call these methods directly.
– They use a ContentResolver object and call its method
s instead
– ContentResolver can talk to any content provider
28
29. Installing and Configuring development Tools
• Android Studio: An easy to use Integrated
Development Environment (IDE) that brings
together Java and the Android SDK to make it
simple to write Android apps.
• Java JDK: The Java Development Kit. Lays
the foundation for the Android SDK.
• Android SDK: Included in Android Studio.
– Provides access to Android libraries and allows
you to develop for Android.
29
31. Adding SDK Packages
• 1. Choose Tools⇒Android⇒SDK Manager to launch the SDK
manager tool.
•
31
32. Setting Up an Emulator
• Like a real android device and allow you to test your application without having a
real device.
1. Choose Tools⇒Android⇒AVD Manager.
The AVD Manager dialog box opens.
32
35. Understanding Project Structure
35
• app: Where your main app code is placed.
• build.gradle: Your top level build file. It tells gradle, the
Android build system, how to build the various subdirectories
in your project.
37. • What the Android manifest file contains
– The name of your application ID for the
application, which is the unique identifier for your
application in the Android system as well as in the
Google Play Store
– The icon for your application
– The components of the application, such as the
activities and background services
– The declaration of the permissions your
application requires to run
37
38. Viewing the build.gradle file
38
The compileSdkVersion tells Android Studio what version of the Android SDK you are
compiling against. This version is set based off the choices you made when you went
through the New Activity Wizard earlier in this chapter.
The buildToolsVersion tells Android Studio what version of the build tools to use
(which is the version of the tools that you installed on your computer).
The applicationId must match the package that you set in your AndroidManifest.xml
file.
39. Lab session
What you'll learn
• How to create a project in Android Studio.
• How to create an emulated Android device.
• How to run your app on the emulator.
• How to run your app on your own physical
device, if you have one.
39
Editor's Notes
Libraries=A collection of similar things.
C++=iostream.h=for input out
conio…
Jquery
Libraries=A collection of similar things.
C++=iostream.h=for input out
conio…
Jquery
Libraries=A collection of similar things.
C++=iostream.h=for input out
conio…
Jquery
KaiOS: company Name…mobile os written with Cascading Style Sheets, JavaScript
Talk About Why Swing is Left Out
Talk about XML
How we design a user Interface
why not go from java source code to delvik(why byte code in between)
Google reasion --> bc java was changing(java 5) in the developement of Delvik so they didnt want to base their work on unstable sruff so they choose Byte code instead