Ch 1: Android Overview Flashcards
Android
Background
- Launched in 2007
- Serves wide range of hardware, not just mobile phones
- Features an open software stack
- Rich set of API Libraries
- System Applications, Bundled Applications and third party Applications are all written using the same APIs
Android API Libraries:
Common Features supported
- Hardware Access, including sensors
- Video Recording
- NFC
- Bluetooth
- Maps
- Location Based Services
- Inter-application communication
- Background Service support
- Relational Databases
- 2D/3D Graphics
Motivation for Android:
Rough History of Phone Apps
- Early native phone applications were generally coded in C or C++
- Required thorough understanding of hardware on individual devices or device families
- Caused app development to lag behind hardware development
- Eventually, Java-Hosted MIDlets were introduced
- Added abstraction to make development easier
- Still restricted and unbalanced access to hardware
- Android OS designed as an Open Development Platform
- Equal and open dev access
Motivation for Android:
MIDlets
Java Hosted MIDlets
- Executed on a Java Virtual Machine (JVM)
- Abstracted underlying hardware
- Allowed developers to create applications that ran on many devices that supported the Java run time
- Came at the price of heavily restricted access to the device hardware
- Hardware access was also uneven, with native applications having more access than third party developers
Three Major Components
of the
Android Ecosystem
- Operating System
- Free and Open Source OS for embedded devices
- Development Platform
- Open Source
- Devices
- Devices that run the Android OS and the applications created for it
Android Ecosystem:
Specific Parts
- Compatibility Definition Document
- Compatibility Test Suite
- Linux operating system Kernel
- Android Run Time (ART)
- Core pre-installed applications
- Application Framework
- User Interface Framework
- Open Source Libraries
- Software Development Kit(SDK)
Android Ecosystem:
Compatibility Definition Document (CDD)
and
Compatibility Test Suite(CTS)
Together, the CDD and CTS describe the capabilities required for a device to support the
Android Software Stack
Android Ecosystem:
Linux Kernel
A Linux operating system kernel provides a low-level interface with:
- hardware
- memory management
- process control
All optimized for mobile and embedded devices
Android Ecosystem:
Open Source Libraries
Open source libraries are available to aid in application development.
Includes:
- SQLite
- WebKit
- OpenGL
- a media manager
Android Ecosystem:
Android Run Time (ART)
Used to execute and host Android applications and the core libraries that provide Android-specific functionality.
Designed to be small and efficient for use on embedded devices.
Android Ecosystem:
Application Framework
Agnostically( not knowing about the device) exposes system services to the application layer.
These services include:
- Window Manager
- Location Manager
- databases
- telephony
- sensors
Android Ecosystem:
User Interface Framework
A framework that is used to host and launch applications. Essentially defines how applications are handled by the system and presented to users.
Android Ecosystem:
Preinstalled Applications
Android devices come with a suite of applications that are expected by users. On a phone:
- Phone dialer
- SMS management app
- Web Browser
- Email client
- Calendar
- Contacts List
- Music Player
- Picture gallery
- Camera and video recording app
- Calculator
- Home screen
- Alarm Clock
Many Android devices also ship with proprietary Google applications
Android SDK:
Major Features supported by
SDK libraries
- Telephony and Internet:
- GSM, EDGE, 3G, 4G, LTE, Wi-Fi
- APIs for location based services
- Both GPS and network-based
- Map integration
- Full multimedia hardware control
- Playback and recording with microphone and camera
- Media Libraries
- Sensor APIs
- Accelerometer
- Compass
- Barometer
- Fingerprint sensors
- Libraries for Wifi, Bluetooth, NFC hardware
- Shared data stores and APIs for contacts, calendar and multi-media
- Background services
- Advanced Notification System
- Integrated web browser
- Graphics support
- Localization through a dynamic resource framework
Benefits of developing for Android
- Access to largest ecosystem of smart phone users
- Diverse range of devices and form factors
- Simple and powerful SDK
- No licensing fees
- Excellent documentation
- Low Barrier to entry
- No required certification
- Google Play store provides many monetization options
- No approval process for app distribution
- Developers have total control over their brands
Programming Languages
used for Android
- Java
- Primary language of Android
- Kotlin
- Full support introduced in Android Studio 3.0
- JVM language
- Interoperable with existing Android languages and the Android Run Time
Java and Kotlin syntax can be used within the same applications
Android Development Framework:
Major Parts
Android Run Time (ART)
Android SDK
(Also Android NDK)
Android Software Stack
Android Application Architecture
Android Development Framework:
Android Run Time( ART)
- Executes and manages all Android applications
- Each application runs in a separate process
- Similar to Java Virtual Machine, but is it’s own runt time designed for efficiency
- ART stops and kills processes as necessary to manage resources
- Handles all responsibility of memory and process management
- Sits on top of a Linux kernel, which handles low-level hardware interaction
- Drivers
- Memory management
- Provides a set of APIs that give applications access to underlying services, features and hardware
Android Development Framework:
Android SDK
Major Features
(What is included “in the box”)
- Android API Libraries
- Development Tools
- Android Emulator
- Runs an Android Virtual Device
- Full Documentation
- Sample Code
- Online Support
Android Development Framework:
Android SDK
Android Emulator
A fully interactive mobile device emulator featuring several alternative skins.
- Runs within an Android Virtual Device(AVD)
- Simulates a device hardware configuration
- Allows you to see how an application will look and behave on a real Android device.
- Hardware-neutral, making it a better independent test environment than any single hardware implementation
Android Development Framework:
Android Software Stack:
What it is
A Linux kernel and a collection of C/C++ libraries,
exposed through an application framework that provides services for, and management of, the run time and applications.
Android Development Framework:
Android Software Stack:
Layers
- Application Layer
- Support/Compatibility/Proprietary Libraries
- Application Framework
- Native(C/C++) Libraries
- Android Run Time
- Hardware Abstraction Layer(HAL)
- Linux Kernel
Android Development Framework:
Android Software Stack:
Support/Compatibility/Proprietary Libraries
Components
- Android Support Library
- Google Play Services
- Firebase
Android Development Framework:
Android Software Stack:
Application Framework
Components
- Views
- Activity Manager
- Fragment Manager
- Window Manager
- Resource Manager
- Notification Manager
- Content Providers
- Telephony Manager
- Package Manager
- Location Manager
Android Development Framework:
Android Software Stack:
Native (C/C++) Libraries:
Components
- Media
- libc
- Graphics (OpenGL, …)
- SQLite
- SSL & Webkit
- many more
Android Development Framework:
Android Software Stack:
Android Runtime
Components
- Android Run Time (ART)
- Android Core Libraries
Android Development Framework:
Android Software Stack:
Hardware Abstraction Layer(HAL)
Components
- Audio
- Bluetooth
- Camera
- Media
- Storage
- Peripherals
- Sensors
- TV
- DRM
- Automotive
Android Development Framework:
Android Software Stack:
Linux Kernel:
Components/Tasks
- Hardware Drivers
- Process Management
- Memory Management
- Binder( IPC )
- Security
- Power Management
Android Development Framework:
Android Software Stack:
Linux Kernel
Summary
Provides core services,
(including hardware drivers, process and memory management, security, network and power management)
The specific kernel version depends on the Android platform version and hardware platform.
Android Development Framework:
Android Software Stack:
Hardware Abstraction Layer( HAL )
Summary
The HAL provides an abstraction layer between the underlying physical device hardware and the remainder of the stack.
(It can let you do that, Dave.)
Android Development Framework:
Android Software Stack:
Native C/C++ Libraries
Summary
Run on top of the kernel and HAL.
Includes various common C/C++ libraries such as libc and SSL, as well as:
- A media library for playback of audio/video
- A surface manager to provide display management
- Graphics libraries, including SGL and OpenGL for 2D and 3D graphics
- SQLite for native database support
- SSL and WebKit for integrated web browser and Internet security
Android Development Framework:
Android Software Stack:
Application Framework
Summary
Provides the classes used to create Android applications.
Also provides a generic abstraction for hardware access and manages the User Interface and Application resources.
Android Development Framework:
Android Software Stack:
Application Layer
Summary
All applications, both native and third party, are built on the application layer by means of the same API libraries.
Runs within the Android Run Time,
using the classes and services made available from the Application Framework
Android Run Time:
Dalvik files
The ART executes Dalvik executable files, with the extension ( .dex )
- Named after an early virtual machine implementation called “Dalvik”
- Format is optimized to ensure minimal memory footprint
- .dex files are created by transforming Java or Kotlin language compiled classes using tools supplied within the SDK
Android Development Framework:
Android Application Architecture
Summary
The Application Architecture encourages component reuse,
enabling you to publish and share Activities, Services and data with other applications, with access managed by security restrictions.
Defines several classes, managers and mechanisms that form the cornerstones of all Android Applications
Android Development Framework:
Android Application Architecture
Cornerstones
-
Activity Manager and Fragment Manager
- Activities and Fragments define the user interface
- The managers control the lifecycle of Activities and Fragments, including the Activity Stack
-
Views
- Used to construct user interface controls
- Notification Manager
- Content Providers
- Resource Manager
-
Intents
- Mechanism for transferring data between applications and their components