0% found this document useful (0 votes)
11 views21 pages

Lecture 2 Android OS

Uploaded by

main2ndacc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views21 pages

Lecture 2 Android OS

Uploaded by

main2ndacc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Mobile App Development XP

Introduction

1
XP
Objectives
• Introduction to Android OS
• History
• Android Versions
• Android OS Architecture

Anubhav Pradhan and Anil V Deshpande: Composing Mobile Apps


2
Android OS XP

• Android is a software package and Linux based


operating system
• It is a Software stack for mobile devices.

• It is developed by Google and later managed by


the OHA (Open Handset Alliance, established in
2007, led by Google) a consortium of 84
companies
• Java language is mainly used to write the android
code 3
History XP

• Initially, Andy Rubin founded Android Incorporation in Palo


Alto, California, United States in October 2003.

• Originally, intended for camera but shifted to smart phones


later because of low market for camera only.

• Android is the nick name of Andy Rubin given by coworkers


because of his love to robots.

• In 2007, Google announces the development of android OS.

• In 2008, HTC launched the first android mobile.

4
Android Versions XP

• Since 2008, Android has seen numerous updates which


have incrementally improved the operating system,
adding new features and fixing bugs in previous releases.

• Each major release is named in alphabetical order


after a dessert or sugary treat, since these devices
make our lives so sweet.

5
Android Versions XP

6
Activity XP

• Find the internal codenames for


– Android 10
– Android 11
– Android 12
– Android 13
– Android 14
– Android 15
• Write down the features added in Android 15

7
Android OS Architecture XP

8
Linus Kernel and HAL XP

• Linux Kernel : Heart of Android Architecture


– manages the system's resources and facilitates communication between hardware and software.

• Why the Linux Kernel?


– Kernels are complex, and the Linux kernel is open source well-established and extensively tested.
– Its broad hardware compatibility supports the diverse ecosystem of Android devices.
– Linux's extensive device driver support enables efficient communication with hardware.

• Memory management, Driver management, Power


management
• Binder driver: allowing sharing of data from one app to
another (inter process communication)

9
Hardware Abstraction Layer (HAL)XP

• Consider: there are millions of phones, appliances, TVs,


streaming boxes, etc. running various versions of Android, and
these in turn have millions of different hardware peripherals
attached to them

• How can we write an app that can interface with all the
different types of hardware components?

10
Hardware Abstraction Layer (HAL)XP

• a bridge between the software running on a system (such as


applications) and the underlying hardware (like Bluetooth
transmitters).

• Its primary role is to abstract the hardware details and provide


a standardized interface for software to interact with various
hardware components.

11
Bridging the Gap with HAL XP

• Imagine developing an app like SnapChat and having to


maintain driver support for every possible camera system in
use on modern phones!
incredibly complex and time-consuming task.

• HAL provides a standardized, API like interface for interacting


with hardware drivers meaning you don’t have to manually
manage drivers for your application.

12
Native C/C++ Libraries XP

• The surface manager library is responsible for rendering windows and drawing
surfaces of various apps on the screen.
• The OpenGL (Open Graphics Library) and SGL (Scalable Graphics Library) are the
graphics libraries for 3D and 2D rendering, respectively.
• The media framework library guides playback and recording of various audio and
video formats.
• The SQLite library provides support for native data storage.
• The FreeType library is used for rendering fonts.
• The WebKit library is used for browser compatibilities and support.
• SSL Secure Sockets Layer library provides security.

13
Android Run Time XP

Android Run Time

Core Libraries

Dalvik Virtual Or
Android Run Time (ART)
Machine (DVM)

• Prior to Android version 5.0 (API level 21), Dalvik


was the Android runtime.

• If your app runs well on ART, then it should work


on Dalvik as well, but the reverse may not be true.

14
Java vs Android Code Execution XP

Java Source Java Source


Code (.java) Code (.java)
Java Complier Java Complier

Java Byte Java Byte Code(.class)

Code(.class) Dex Compiler

Java Interpreter Dalvik Byte Code( .dex)

Java Virtual
Machine(JVM)
Dalvik Virtual
Machine(DVM)

15
The Dex File Format XP

• The .dex file format, or Dalvik Executable, is a specialized


bytecode format tailored for the Android system.

• Dex is designed for more space efficiency, often resulting in


less than half the program size compared to equivalent JVM
bytecode, making it a more compact and optimized format.

• Dex files can be generated by translating existing Java


bytecode (class files) or directly compiling the original Java
code using a dedicated compiler.

16
Compilation and Execution Cycle XP

• Begin with a Java program, typically written by developers.

• Compile the Java program into Java bytecode using a Java compiler.

• Translate the Java bytecode into Dex bytecode, a specialized format for
Android applications.

• The Dex bytecode along with necessary resources is packaged into an APK
(Android Package Kit) for distribution to users.

• The Android Runtime (ART) will precompile the Dex bytecode into native
machine code, optimizing it for the specific hardware of the user's phone.

17
JIT Vs AOT XP

JIT (Just In time) AOT (Ahead of time)

• Compile Source Code to • Compile Source Code before


machine code during Run time. execution(during app installation)
• Each time an app runs .dex file • Improves Run time Performance
is converted. • Increase overhead during app
• Each file is compiled separately installation

18
Application Framework XP

• The Application Framework layer in Android provides a set of essential APIs (Application
Programming Interfaces) that abstract the underlying system operations and facilitate the
development of Android applications

• Activity Manager: interacts with the user


• The telephony manager enables app to leverage phone capabilities of the device.
• The resource manager is used to store the resources of an app such as strings, layouts, audio,
video, icons, animation
• The view system contains the User Interface (UI) building blocks such as buttons, check boxes,
and imageView, listView etc.
• The location manager deals with location awareness capabilities.
• Notification manager deals with visual, audio and vibration signal notifications
• XAMP is used for extensible messaging (such as chat applications)

19
Applications Layer XP

• The applications layer is the topmost layer that contains all the apps installed
on the device, including those that come bundled with it.

• This layer uses all the layers below it for proper functioning of these mobile apps.

20
Next class XP

In the next class we will learn about

How to create first app

21

You might also like