timmins training consulting sdn. bhd

13
Android Internals 70% Hands-on Exercise Timmins Training Consulng Sdn. Bhd. DURATION: 5 days consult-timmins.com

Upload: others

Post on 27-Nov-2021

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Timmins Training Consulting Sdn. Bhd

Android Internals

70% Hands-on Exercise

Timmins Training Consulting Sdn. Bhd.

DURATION: 5 days

consult-timmins.com

Page 2: Timmins Training Consulting Sdn. Bhd

Our Training Profile

We customize the content

Timmins Training Consulting was established in 2015. We are an HRDF registered training provider and our courses are HRDF claimable.

We have done hundreds days of training sessions in many countries including Malaysia, Singapore, Indonesia, China, Taiwan, India Canada and USA.

We have diverse clientele from telecommunications, information technology, finance, semi-conductor, manufacturing and oil & gas sectors.

Our training programmes include courses in:

Why choose Timmins?

About Us - Timmins Training Consulting

TelecommunicationsSoftware Development

Web Development

Artificial Intelligence & Data Semiconductor

Embedded Programming

Professional Development

We work with subject matter expertsWe provide experiential learning

TimminsTrainingConsulting

Timmins Training Consulting Sdn. Bhd.

Page 3: Timmins Training Consulting Sdn. Bhd

Timmins clients include:Our clients come from Malaysia, Singapore, Thailand, Indonesia, India, China, Canada and USA.

TimminsTrainingConsulting

Timmins Training Consulting Sdn. Bhd.

Page 4: Timmins Training Consulting Sdn. Bhd

PRE-REQUISITES• Familiarity with Linux and linux kernel • Good knowledge of core Java and C• At least 2-3 years of development experience required

This is an intensive course that unravels the entire stack of Android with special emphasis on the versions O P and Q from the per-spective of designing custom Android devices.In this course the architecture of Android - covering both its design and its implementa-tion would be thoroughly analysed. All aspects of the entire Android Stack would be examined. Exactly what it inherits from its Linux core, as well as how it diverges with its idiosyncrasies and “Android-isms”would be highlighted. Internals of the architecture such as the Dalvik Virtual Machine, Android RunTime (ART), the Binder IPC mechanism, the Java Framework layer, the Native Framework Layer, the binderized Hardware Abstraction Layer (HAL) and the SE policy framework would be peeled and exposed with the help practical exercises which would amount to 50% of the course duration.

DESCRIPTION

COURSE OBJECTIVES• Describe the architecture of the Android operating system• Describe the similarities between Linux and Android• Describe the differences between Linux and Android• Describe the functions and architecture of the Androidized Kernel• Understand the role of Java frameworks of Android• Understand the role of Native frameworks of Android • Understand the role of Java Native Interface ( JNI )• Understand the service architecture of Android• Understand the Hardware Abstraction Layer ( HAL ) of Android• Understand the binderized HAL of Android• Understand the hardware service of Android• Understand the vendor binder of Android• Understand the essentials of SE-Linux• Understand the SE policy framework of Android• Understand the Compliance Definition Document provisions• Understand and resolve the Google Certification conundrum• To be able to practically design architect and implement custom Android devices and services

Timmins Training Consulting

Page 5: Timmins Training Consulting Sdn. Bhd

Android Internals

• Android Emulator architecture, • Emulator vs hardware board,• Tools - adb, logcat

• Setting up an Android build system• Obtaining the Android source tree• The Android build system and an

introduction to device configuration files• Selecting the target product and build

variant• Building Android system images from

source• Running custom Android images on Hikey/

Nitrogen8M board

Android Emulator

Getting and building the code from the An-droid Open Source Project

• Where to find the source for Android’s custom kernel

• Binder: Android’s primary inter-process communication (IPC) mechanism

• Anonymous shared memory (ashmem): Android’s replacement for POSIX SHM

• Android’s physical memory allocator, ION• Android power management extensions: wakelocks,

early suspend, and alarms• Android’s low-memory process killer• The Android logging system• Android’s user and group management and kernel

security enforcement (the “paranoid network security” kernel option)

The Androidized Linux kernel: Differences from mainline Linux

• Android overall architecture• Android Open Source Project (AOSP)• Embedded Linux fundamentals• Android Stack Module• Android Kernel Layer• Android Native Layer• Android Application Framework Layer• Android Applications Layer

Introduction to Android01

02 04

03

Timmins Training Consulting

Page 6: Timmins Training Consulting Sdn. Bhd

Android Internals

• Bootloader,Secure boot - chain of trust• ARM trustzone, Verified boot,

Seecomp(Secure Computing mode)• Storage security• Fastboot unlocking bootloader, commands

• SELinux in Android(SEAndroid), sepolicy, labels, rules

• Defining policies, allow, neverallow

• Bootloading the kernel• The init process and Android’s init scripting

language• The standard boot process and how to

customize it• The purpose of the Zygote daemon• Startup of system services

Boot Loader and fastboot

Android security - SELinux

Starting up: the Android init process and init.rc scripts

• Setting up a custom device directory structure• Registering a custom device with Android’s build

system• Adding the Makefile plumbing for a device• Generating platform signing keys• Adding a custom kernel• Adding a custom native library and executable• Adding a custom daemon• Creating a custom Java library to expose a native

library• Consuming a custom Java/JNI library via a custom

application

Creating a Customized Android System Image05

06

07

08

Timmins Training Consulting

Page 7: Timmins Training Consulting Sdn. Bhd

Android Internals

• Hardware abstraction and HIDL interface, Vendor HAL

• Project Treble overview• Framework and vendor space isolation and

Update process - vndk and vintf • Vendor HAL extention - vndbinder, hwbinder

• Hardware abstraction and HIDL interface, Vendor HAL

• Project Treble overview• Framework and vendor space isolation and Update

process - vndk and vintf • Vendor HAL extention - vndbinder, hwbinder

• First look• Anatomy of an application• Native code• Activities• Lifecycle Management• Manifest File• Resources• Services• Intents

HAL and HIDL interface

HAL and HIDL interface

Applications in Android from the perspective of writing test suites to validate the platform

• Bionic: Android’s implementation of libc and how it differs from the BSD libc

• User-space Hardware Abstraction Layer (HAL): standard APIs for accessing hardware

• Overview of standard Android native daemons (e.g., adbd, rild, ueventd, etc.) and their purpose

• Overview of other Android function libraries and frameworks

• The Dalvik Virtual Machine (VM)/ ART and how it differs from a Java VM

Android Native Layer09

10

10

11

Timmins Training Consulting

Page 8: Timmins Training Consulting Sdn. Bhd

Android Internals

• Creating custom Parcelable Java types for use with Binder

• Exposing a Binder-based interface from an application

• Asynchronous Binder interactions

• Android application structure• Standard Android system applications, wallpapers,

and input method editors

• JNI development process overview• Implementing Java methods in native code• Mapping Java types to native types• Managing object references in native code• Managing Strings, arrays, and other Java object

types in native code• Throwing and catching exceptions in native code• Using NDK to incorporate native code in an app• Supporting multiple machine architectures with

NDK• NDK “stable” APIs

Interface Definition Language (AIDL)

Android’s hardware abstraction layer

Accessing native (C/C++) code from an Android application

• Bionic: Android’s implementation of libc and how it differs from the BSD libc

• User-space Hardware Abstraction Layer (HAL): standard APIs for accessing hardware

• Overview of standard Android native daemons (e.g., adbd, rild, ueventd, etc.) and their purpose

• Overview of other Android function libraries and frameworks

• The Dalvik Virtual Machine (VM)/ ART and how it differs from a Java VM

Android Inter-Process Communication (IPC) with Binder and AIDL12

13

14

15

Timmins Training Consulting

Page 9: Timmins Training Consulting Sdn. Bhd

Timmins Training Consulting

Android Internals

• The Google Certification conundrum• CDD • Compliance Test Suite • The Vendor Test Suite

Google certification and the Compliance Defini-tion Document ( CDD )

Summary, Q&A and closure

• Generic structure and flow of a service• Example - Camera , Media, Audio, Power

Management Service, Alarm Service

Android Subsystems16

17

18

Page 10: Timmins Training Consulting Sdn. Bhd

Hands-On Exercises

Timmins Training Consulting

• Building AOSP for Hikey 96/Nitrogen 8M board and deploying it on the hardware. • Write a lib.so that would serve as a pseudo driver module in the user space • Using HIDL write a binderized HAL component to interface with the pseudo driver

module • Create a native lib.so that interacts with the pseudo driver module through the HAL

interface. • Write a native application that would cause the invocation of the pseudo driver

functions through the native library and binderized HAL. • Build the AOSP with the application, native library , binderized HAL and the user space

pseudo driver and deploy it in the HIKEY 96/Nitrogen 8M board • Write the same pseudo driver as a kernel module • Using HIDL write a binderized HAL component to interface with the pseudo driver

kernel module • Write a native lib.so that interacts with the kernel module functions through HAL

interface• Create a service API in the Java layer using JNI to invoke the native library functions • Using AIDL create an Android service component that can be registered as a

Framework service. • Write an Android application using Android Studio that uses the newly created service. • Build the AOSP with all of the relevant components for HIkey 96 /Nitrogen 8M board. • Execute and check the functionalities.

Page 11: Timmins Training Consulting Sdn. Bhd

• Ph. D in Computer Science and Engineering. • B. E. (Honors) in Electronics and Communication Engineering.

Education

FACILITATOR

• Corporate Training (21 Years)• Lecturer, Dept. of Computer Science & Engineering, • Professor and Head of the Dept. of Computer Science & Engineering, (5 Years)

Teaching and Corporate Training Experience

• 21 years in Corporate training as an independent consultant• 9 years and 6 months in Research & Development• 5 years in Teaching as Professor and Head of the Department of Computer Science and Engineering.

Total Professional Experience

Timmins Training Consulting

Page 12: Timmins Training Consulting Sdn. Bhd

Our clients say

Timmins Training Consulting

“In-depth Linux kernel internal is the best thing of the training”

“Stories or real life examples, practical stuff we can use at work”

“The trainer has a very deep knowledge on Embedded Linux. He could able to answer and explain very well for all question we asked”

“Prof. Chockalingam great instructor and explained very very detail in the subject”

“Relevance of the topics presented to what is actually required for my work. Exercises help visualize the top-ics taught. Clear explanation and presentation of the topics in a way that is easy to understand”

“The Professor meticulously conveyed the points in the most well thought out terminology possible which makes absorbing and remembering the points easier.

“Trainer is very experienced in the subject. Able to help us to understand some important concepts in Linux”

“Relevance of the topics presented to what is actually required for my work. Exercises help visualize the topics taught. Clear explanation and presentation of the topics in a way that is easy to understand”

“The instructor method to ensure all the participants understand and follow”

“Group discussion and practical exercise are really good”

Page 13: Timmins Training Consulting Sdn. Bhd

Contact Us

Email : [email protected]: 0327850737Mobile : +6016444351776 Jalan Raja Muda Abdul Aziz, Jalan Tun Razak, 50300 Kuala Lumpur, Wilayah Persekutuan.

Email : [email protected]: +622152917494Mobile : +628159859825IDX Building, Tower 2, 17th Floor, jalan Jend. Sudirman Kav 52-53 Jakarta 12190, Indonesia.

Website: consult-timmins.com

PT Timmins Konsultan Utama

Timmins Training Consulting Sdn. Bhd.

TimminsTrainingConsulting