SlideShare a Scribd company logo
1 of 42
Vladimir Kotov Android Internals and Toolchain 1
I. Android Internals
Vladimir Kotov Android Internals and Toolchain 2
Android platform
Android is a Linux-based operating system and a
software stack designed for mobile devices
Key Applications
Home, Phone, Browser
Application Framework
Java layer system services
Middlewares
Libraries, Dalvik VM
Operating system
Linux kernel
Vladimir Kotov Android Internals and Toolchain 3
Android platform
Developed by Google*
2005 – purchased Android Inc
2007 – established Open Handset Alliance (OHA)
2012 – Oracle v. Google on Java API
Compatibility
Definition
Document
to certify devices
SDK + tools
to create
applications
Vladimir Kotov Android Internals and Toolchain 4
Android platform
Main hardware platform for Android is ARM
● support for x86 from the Android x86 project
Advanced RISC Machine
● 7.9 billion shipped in 2011
– 95% smartphones
– 90% hard disk drives
● Reduced instruction set computing (RISC)
● Lower costs, Less heat, Less power usage
● Reduced complexity and simpler design
● Good interfacing to many devices
Vladimir Kotov Android Internals and Toolchain 5
Android Anatomy
Vladimir Kotov Android Internals and Toolchain 6
Android Linux Kernel
Android kernel based on Linux 2.6 and 3.x (Android 4.0)
● Why Linux?
● Great memory and process management
● Permissions-based security model
● Proven driver model
● Support for shared libraries
● Open source
Vladimir Kotov Android Internals and Toolchain 7
Android Linux Kernel
Android “is not Linux”
● Users never see Linux sub system
● Not the full set of standard Linux utilities
● August 2011, Linus Torvalds - "eventually Android and
Linux would come back to a common kernel, but it will
probably not be for four to five years"
Vladimir Kotov Android Internals and Toolchain 8
Android Linux Kernel
Android patch of kernel enhancements
● Power Management
● Ashmem
● Binder IPC
● Low Memory Killer
December 2011 - Android Mainlining
Project to put some Android drivers,
patches and features back into the
Linux kernel
Vladimir Kotov Android Internals and Toolchain 9
Android Native Libraries
Vladimir Kotov Android Internals and Toolchain 10
Android Native Libraries
● Bionic Libc
● Fast and small, license-friendly, optimized for mobile
● Function Libraries
● WebKit, Media Framework, SQLite
● Native Servers
● Surface Manager, Audio Manager
● Hardware Abstraction Libraries
● WiFi, Bluetooth, GPS, Camera
Vladimir Kotov Android Internals and Toolchain 11
Android Runtime
Vladimir Kotov Android Internals and Toolchain 12
Android Runtime
On Android you develop in Java
... but Android does not run Java Bytecode !
Vladimir Kotov Android Internals and Toolchain 13
Android Runtime
Constraints
Designed for 64M RAM
No swap
Phone tech v. Desktop
CPU specific
Oracle JVM problems
Memory Hog
Slow startup
IP licensing restrictions
Custom Virtual Machine. Why?
Vladimir Kotov Android Internals and Toolchain 14
Android Runtime
Dalvik Virtual Machine
● Custom VM optimized for mobile devices
● Register-based JVM
● More efficient and compact
● Use memory efficiently
● Dalvik Executable Code (.dex)
– 30% fewer instructions
– 35% fewer code units
● Trace JIT compiler (since 2.2)
Vladimir Kotov Android Internals and Toolchain 15
Android Runtime
Android Java = Java language + Dalvik + Apache Harmony
Android Java API = Java SE – AWT/Swing + Android API
Sun-Java = Java language + JVM + JDK
Vladimir Kotov Android Internals and Toolchain 16
Android Runtime
Zygote spawns VM processes
● Already has core libraries loaded
● When an app is launched, zygote is forked
● Fork core libraries are shared with zygote
● Solves HotSpot start-up performance and memory problems
Vladimir Kotov Android Internals and Toolchain 17
Android Runtime
Vladimir Kotov Android Internals and Toolchain 18
Android Runtime
Vladimir Kotov Android Internals and Toolchain 19
Android Runtime
● Core libraries
● Core APIs for Java language (IO, Structures, ...)
● Core Platform Services, Application Framework
● Activity Manager, Package Manager, Window Manager,
Resource Manager, Content Providers, View System
● Hardware Services
● Telephony, Location, Bluetooth, WiFi, USB, Sensor
Vladimir Kotov Android Internals and Toolchain 20
II. Android Developer Toolchain
Vladimir Kotov Android Internals and Toolchain 21
Android offer
The first open* and comprehensive platform for mobile
devices
● an operating system, user-interface and applications
● a mobile phone without the proprietary obstacles that
have hindered mobile innovation
● an open-source development platform
Vladimir Kotov Android Internals and Toolchain 22
Android offer
● Apps are equivalent parts of the phone
using the same API
● Reuse and replacement of application
components
● GSM, EDGE, 3G, 4G, LTE data transfer
● Comprehensive location-based APIs
● Wi-Fi hardware access and peer-to-peer
connection
Vladimir Kotov Android Internals and Toolchain 23
Android offer
● Full multimedia hardware control, media
libraries
● APIs for sensor hardware
● Libraries for Bluetooth and NFC
● Shared data stores and APIs for contacts,
social networking
● Background Services, applications, and
processes
● Home-screen Widgets and Live Wallpaper
Vladimir Kotov Android Internals and Toolchain 24
Android Developer Challenge
● A developer challenge Google hold every
year for Android mobile platform
● Demonstrates the capabilities of Android
platform
● Developers submit their apps to one of 10
specially-designated ADC categories
● Top 20 applications in each category will
proceed to the second round
● Community vote constituting 40% of the
final judging score
Vladimir Kotov Android Internals and Toolchain 25
Accessory Development Kit
● RI for building accessories
for Android
● Source code and hardware
specifications
● ADK 2012 is based on the
Arduino open source
electronics prototyping
platform
Install Android
What do we need for Android?
• Android SDK
• ADT (Android Developer Tools)
• AVD (Android Virtual Device)
Vladimir Kotov Android Internals and Toolchain 27
Android SDK
● Android APIs
Developer access to the Android stack
● Development tools
Compile and debug your applications
● Android Virtual Device Manager
● Emulator
● Documentation
● Sample code
Vladimir Kotov Android Internals and Toolchain 28
Android SDK
● http://developer.android.com/sdk (Linux, Mac OS X, Windows)
● Installation Option1: SDK Tools Only
● Initially contains only the basic SDK tools
● Need to install the Platform-tools and Android platform(s)
● Installation Option2: ADT Bundle
● Eclipse + ADT plugin
● Android SDK Tools
● Android Platform-tools
● The latest Android platform
● The latest Android system image for the emulator
Vladimir Kotov Android Internals and Toolchain 29
Android SDK
SDK Manager.exe (Windows) v. tools/android (Mac, Linux)
Vladimir Kotov Android Internals and Toolchain 30
Android SDK
SDK packages
<sdk>/tools/ Tools for debugging and testing, utilities to
develop an app (sdk manager, ddms, emulator)
<sdk>/platform-
tools/
Platform-dependent tools for developing, support
latest features of the Android platform and are
updated with new platform (adb, fastboot, aapt)
<sdk>/docs/
<sdk>/sources/
Latest documentation for the Android APIs
<sdk>/platforms/ a) SDK Platform for each version of Android,
android.jar with a fully compliant Android library
b) System images for Android emulator
<sdk>/add-ons/
<sdk>/extras/
Special APIs and static libraries you can include
in your app sources in order to use powerful APIs
that aren't available in the standard platform
Vladimir Kotov Android Internals and Toolchain 31
Android Development Tools
● Eclipse plugin
● Professional-grade development environment
● Free, open-source, and runs on most major OS
● Provides the emulator
Vladimir Kotov Android Internals and Toolchain 32
Android Development Tools
● Tooling
● Wizard for creating new project
● WYSWYG UI Designer
● Code / XML editor
● Integrated with
● AVD Manager
● DDMS
Vladimir Kotov Android Internals and Toolchain 33
ADT Installation Options
● ADT Bundle
provides everything you need to start - Eclipse IDE with
built-in ADT
Eclipse Juno Release
● Existing IDE
Download ADT plugin
– Help > Install New Software.
– Add Repository
https://dl-ssl.google.com/android/eclipse/
Configure ADT plugin
Vladimir Kotov Android Internals and Toolchain 34
Android Emulator
● QEMU-based
● Same image as on device
● Same toolchain to work with
device or emulator
● Mimics all of the hardware and
software features of a typical
mobile device
● Startup may be slow, try “Graphics
Acceleration” and “Virtual Machine
Acceleration”, or use a device
instead
Vladimir Kotov Android Internals and Toolchain 35
Android Virtual Device
● Android Virtual Device (AVD) is an emulator configuration
to model an actual device by defining hardware and
software options
● Hardware profile - hardware features (camera,
physical, memory)
● Mapping to a system image - version of the Android
platform will run on the virtual device
● Dedicated storage area - the device's user data,
emulated SD card
● Other options - emulator skin, emulated SD card
Vladimir Kotov Android Internals and Toolchain 36
Develop on Hardware Devices
● Use any Android hardware device
● Deploy your app to connected
devices directy from the IDE
● Live, on-device debugging, testing,
and profiling
● Enable debugging over USB
● Developer options in the system
Settings
Vladimir Kotov Android Internals and Toolchain 37
Dalvik Debug Monitor Server
(DDMS)
● Works with both the emulator and a connected device
● Capabilities
● Heap usage for a process
● Track memory allocation of objects
● Work with an emulator or device's file system
● Examining thread information
● Network Traffic tool (Android 4.0)
● LogCat
Vladimir Kotov Android Internals and Toolchain 38
DEMO
Vladimir Kotov Android Internals and Toolchain 39
Usefull SDK utilities
Android Debug Bridge
(adb)
Command line tool to communicate with an
emulator instance or device (client, server,
daemon)
Important commands:
- devices – show device list
- install – install application file
- pull / push – copy files to/from device
- logcat - print log data
- shell – start remote shell on device
Android Device
Monitor (monitor)
Tool for Android application debugging and
analysis without ADT
Hierarchy Viewer
(hierarchyviewer)
Debug and optimize your user interface. Visual
representation of the layout's View hierarchy
ProGuard Obfuscates your code
Vladimir Kotov Android Internals and Toolchain 40
Native development kit (NDK)
● Tools to build and compile your native code for
the device architecture
● A way to package your library into the APK file to
distribute your application easily
● A set of native system headers supported for
Android platform (libc, libz, liblog, JNI headers)
● Documentation, samples
If the speed and efficiency of C/C++ is required
Vladimir Kotov Android Internals and Toolchain 41
Application creation cycle
Vladimir Kotov Android Internals and Toolchain 42
Hello, world ... finally
DEMO

More Related Content

What's hot

Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowOpersys inc.
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoTOpersys inc.
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming BasicDuy Do Phan
 
Android App Development Intro at ESC SV 2012
Android App Development Intro at ESC SV 2012Android App Development Intro at ESC SV 2012
Android App Development Intro at ESC SV 2012Opersys inc.
 
Embedded Android Workshop at AnDevCon IV
Embedded Android Workshop at AnDevCon IVEmbedded Android Workshop at AnDevCon IV
Embedded Android Workshop at AnDevCon IVOpersys inc.
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave InternalsOpersys inc.
 
Embedded Android Workshop at AnDevConII
Embedded Android Workshop at AnDevConIIEmbedded Android Workshop at AnDevConII
Embedded Android Workshop at AnDevConIIOpersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Android development classes in chandigarh : Big Boxx Academy
Android development classes in chandigarh : Big Boxx AcademyAndroid development classes in chandigarh : Big Boxx Academy
Android development classes in chandigarh : Big Boxx AcademyBig Boxx Animation Academy
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALOpersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security InternalsOpersys inc.
 
Is Android the New Embedded Linux? at AnDevCon IV
Is Android the New Embedded Linux? at AnDevCon IVIs Android the New Embedded Linux? at AnDevCon IV
Is Android the New Embedded Linux? at AnDevCon IVOpersys inc.
 
Android things introduction - Development for IoT
Android things introduction - Development for IoTAndroid things introduction - Development for IoT
Android things introduction - Development for IoTBartosz Kosarzycki
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowKarim Yaghmour
 
Evolution of Android Update Principles
Evolution of Android Update PrinciplesEvolution of Android Update Principles
Evolution of Android Update PrinciplesGlobalLogic Ukraine
 

What's hot (20)

Android : Deep dive into developing MobileApp using Android
Android : Deep dive into developing MobileApp using AndroidAndroid : Deep dive into developing MobileApp using Android
Android : Deep dive into developing MobileApp using Android
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoT
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming Basic
 
Android App Development Intro at ESC SV 2012
Android App Development Intro at ESC SV 2012Android App Development Intro at ESC SV 2012
Android App Development Intro at ESC SV 2012
 
Embedded Android Workshop at AnDevCon IV
Embedded Android Workshop at AnDevCon IVEmbedded Android Workshop at AnDevCon IV
Embedded Android Workshop at AnDevCon IV
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
 
Embedded Android Workshop at AnDevConII
Embedded Android Workshop at AnDevConIIEmbedded Android Workshop at AnDevConII
Embedded Android Workshop at AnDevConII
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Android development classes in chandigarh : Big Boxx Academy
Android development classes in chandigarh : Big Boxx AcademyAndroid development classes in chandigarh : Big Boxx Academy
Android development classes in chandigarh : Big Boxx Academy
 
Project Ara
Project AraProject Ara
Project Ara
 
Project Ara
Project AraProject Ara
Project Ara
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
 
What & How to Customize Android?
What & How to Customize Android?What & How to Customize Android?
What & How to Customize Android?
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security Internals
 
Is Android the New Embedded Linux? at AnDevCon IV
Is Android the New Embedded Linux? at AnDevCon IVIs Android the New Embedded Linux? at AnDevCon IV
Is Android the New Embedded Linux? at AnDevCon IV
 
Android things introduction - Development for IoT
Android things introduction - Development for IoTAndroid things introduction - Development for IoT
Android things introduction - Development for IoT
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Evolution of Android Update Principles
Evolution of Android Update PrinciplesEvolution of Android Update Principles
Evolution of Android Update Principles
 

Similar to Android Internals and Toolchain

Introduction to Android
Introduction to Android Introduction to Android
Introduction to Android Ranjith Kumar
 
Android seminar report
Android seminar reportAndroid seminar report
Android seminar reportdgpune
 
Mobile development
Mobile developmentMobile development
Mobile developmentSayed Ahmed
 
An introduction on Android OS, its working and android development
An introduction on Android OS, its working and android developmentAn introduction on Android OS, its working and android development
An introduction on Android OS, its working and android developmentSanskar Saraf
 
Android understanding
Android understandingAndroid understanding
Android understandingRamesh Rao
 
An introduction on Android OS, its working and android development
An introduction on Android OS, its working and android developmentAn introduction on Android OS, its working and android development
An introduction on Android OS, its working and android developmentSanskar Saraf
 
Mobile development
Mobile developmentMobile development
Mobile developmentSayed Ahmed
 
3. Android Architecture.pptx
3. Android Architecture.pptx3. Android Architecture.pptx
3. Android Architecture.pptxHarshiniB11
 
Dload mobile development
Dload mobile developmentDload mobile development
Dload mobile developmentSayed Ahmed
 
Getting started with android
Getting started with androidGetting started with android
Getting started with androidamitgb
 
Android development tutorial
Android development tutorialAndroid development tutorial
Android development tutorialnazzf
 
Introduction to android applications stu
Introduction to android applications stuIntroduction to android applications stu
Introduction to android applications stucbashirmacalin
 
Android development tutorial
Android development tutorialAndroid development tutorial
Android development tutorialMohammad Taj
 
e-Business - Mobile development trends
e-Business - Mobile development trendse-Business - Mobile development trends
e-Business - Mobile development trendsVladimir Kotov
 

Similar to Android Internals and Toolchain (20)

Introduction to Android
Introduction to Android Introduction to Android
Introduction to Android
 
Android Programming
Android ProgrammingAndroid Programming
Android Programming
 
Android seminar report
Android seminar reportAndroid seminar report
Android seminar report
 
Mobile development
Mobile developmentMobile development
Mobile development
 
An introduction on Android OS, its working and android development
An introduction on Android OS, its working and android developmentAn introduction on Android OS, its working and android development
An introduction on Android OS, its working and android development
 
Android understanding
Android understandingAndroid understanding
Android understanding
 
An introduction on Android OS, its working and android development
An introduction on Android OS, its working and android developmentAn introduction on Android OS, its working and android development
An introduction on Android OS, its working and android development
 
01 03 - introduction to android
01  03 - introduction to android01  03 - introduction to android
01 03 - introduction to android
 
Mobile development
Mobile developmentMobile development
Mobile development
 
3. Android Architecture.pptx
3. Android Architecture.pptx3. Android Architecture.pptx
3. Android Architecture.pptx
 
Android
AndroidAndroid
Android
 
Dload mobile development
Dload mobile developmentDload mobile development
Dload mobile development
 
Getting started with android
Getting started with androidGetting started with android
Getting started with android
 
Android development tutorial
Android development tutorialAndroid development tutorial
Android development tutorial
 
Android course (lecture1)
Android course (lecture1)Android course (lecture1)
Android course (lecture1)
 
Introduction to android applications stu
Introduction to android applications stuIntroduction to android applications stu
Introduction to android applications stu
 
Android development tutorial
Android development tutorialAndroid development tutorial
Android development tutorial
 
Chapter1
Chapter1Chapter1
Chapter1
 
e-Business - Mobile development trends
e-Business - Mobile development trendse-Business - Mobile development trends
e-Business - Mobile development trends
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 

More from Vladimir Kotov

More from Vladimir Kotov (7)

e-Business - SE trends
e-Business - SE trendse-Business - SE trends
e-Business - SE trends
 
LDP lecture 2
LDP lecture 2LDP lecture 2
LDP lecture 2
 
LDP lecture 1
LDP lecture 1LDP lecture 1
LDP lecture 1
 
LDP lecture 5
LDP lecture 5LDP lecture 5
LDP lecture 5
 
LDP lecture 4
LDP lecture 4LDP lecture 4
LDP lecture 4
 
LDP lecture 3
LDP lecture 3LDP lecture 3
LDP lecture 3
 
Android Working in the Background
Android Working in the BackgroundAndroid Working in the Background
Android Working in the Background
 

Recently uploaded

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Recently uploaded (20)

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Android Internals and Toolchain

  • 1. Vladimir Kotov Android Internals and Toolchain 1 I. Android Internals
  • 2. Vladimir Kotov Android Internals and Toolchain 2 Android platform Android is a Linux-based operating system and a software stack designed for mobile devices Key Applications Home, Phone, Browser Application Framework Java layer system services Middlewares Libraries, Dalvik VM Operating system Linux kernel
  • 3. Vladimir Kotov Android Internals and Toolchain 3 Android platform Developed by Google* 2005 – purchased Android Inc 2007 – established Open Handset Alliance (OHA) 2012 – Oracle v. Google on Java API Compatibility Definition Document to certify devices SDK + tools to create applications
  • 4. Vladimir Kotov Android Internals and Toolchain 4 Android platform Main hardware platform for Android is ARM ● support for x86 from the Android x86 project Advanced RISC Machine ● 7.9 billion shipped in 2011 – 95% smartphones – 90% hard disk drives ● Reduced instruction set computing (RISC) ● Lower costs, Less heat, Less power usage ● Reduced complexity and simpler design ● Good interfacing to many devices
  • 5. Vladimir Kotov Android Internals and Toolchain 5 Android Anatomy
  • 6. Vladimir Kotov Android Internals and Toolchain 6 Android Linux Kernel Android kernel based on Linux 2.6 and 3.x (Android 4.0) ● Why Linux? ● Great memory and process management ● Permissions-based security model ● Proven driver model ● Support for shared libraries ● Open source
  • 7. Vladimir Kotov Android Internals and Toolchain 7 Android Linux Kernel Android “is not Linux” ● Users never see Linux sub system ● Not the full set of standard Linux utilities ● August 2011, Linus Torvalds - "eventually Android and Linux would come back to a common kernel, but it will probably not be for four to five years"
  • 8. Vladimir Kotov Android Internals and Toolchain 8 Android Linux Kernel Android patch of kernel enhancements ● Power Management ● Ashmem ● Binder IPC ● Low Memory Killer December 2011 - Android Mainlining Project to put some Android drivers, patches and features back into the Linux kernel
  • 9. Vladimir Kotov Android Internals and Toolchain 9 Android Native Libraries
  • 10. Vladimir Kotov Android Internals and Toolchain 10 Android Native Libraries ● Bionic Libc ● Fast and small, license-friendly, optimized for mobile ● Function Libraries ● WebKit, Media Framework, SQLite ● Native Servers ● Surface Manager, Audio Manager ● Hardware Abstraction Libraries ● WiFi, Bluetooth, GPS, Camera
  • 11. Vladimir Kotov Android Internals and Toolchain 11 Android Runtime
  • 12. Vladimir Kotov Android Internals and Toolchain 12 Android Runtime On Android you develop in Java ... but Android does not run Java Bytecode !
  • 13. Vladimir Kotov Android Internals and Toolchain 13 Android Runtime Constraints Designed for 64M RAM No swap Phone tech v. Desktop CPU specific Oracle JVM problems Memory Hog Slow startup IP licensing restrictions Custom Virtual Machine. Why?
  • 14. Vladimir Kotov Android Internals and Toolchain 14 Android Runtime Dalvik Virtual Machine ● Custom VM optimized for mobile devices ● Register-based JVM ● More efficient and compact ● Use memory efficiently ● Dalvik Executable Code (.dex) – 30% fewer instructions – 35% fewer code units ● Trace JIT compiler (since 2.2)
  • 15. Vladimir Kotov Android Internals and Toolchain 15 Android Runtime Android Java = Java language + Dalvik + Apache Harmony Android Java API = Java SE – AWT/Swing + Android API Sun-Java = Java language + JVM + JDK
  • 16. Vladimir Kotov Android Internals and Toolchain 16 Android Runtime Zygote spawns VM processes ● Already has core libraries loaded ● When an app is launched, zygote is forked ● Fork core libraries are shared with zygote ● Solves HotSpot start-up performance and memory problems
  • 17. Vladimir Kotov Android Internals and Toolchain 17 Android Runtime
  • 18. Vladimir Kotov Android Internals and Toolchain 18 Android Runtime
  • 19. Vladimir Kotov Android Internals and Toolchain 19 Android Runtime ● Core libraries ● Core APIs for Java language (IO, Structures, ...) ● Core Platform Services, Application Framework ● Activity Manager, Package Manager, Window Manager, Resource Manager, Content Providers, View System ● Hardware Services ● Telephony, Location, Bluetooth, WiFi, USB, Sensor
  • 20. Vladimir Kotov Android Internals and Toolchain 20 II. Android Developer Toolchain
  • 21. Vladimir Kotov Android Internals and Toolchain 21 Android offer The first open* and comprehensive platform for mobile devices ● an operating system, user-interface and applications ● a mobile phone without the proprietary obstacles that have hindered mobile innovation ● an open-source development platform
  • 22. Vladimir Kotov Android Internals and Toolchain 22 Android offer ● Apps are equivalent parts of the phone using the same API ● Reuse and replacement of application components ● GSM, EDGE, 3G, 4G, LTE data transfer ● Comprehensive location-based APIs ● Wi-Fi hardware access and peer-to-peer connection
  • 23. Vladimir Kotov Android Internals and Toolchain 23 Android offer ● Full multimedia hardware control, media libraries ● APIs for sensor hardware ● Libraries for Bluetooth and NFC ● Shared data stores and APIs for contacts, social networking ● Background Services, applications, and processes ● Home-screen Widgets and Live Wallpaper
  • 24. Vladimir Kotov Android Internals and Toolchain 24 Android Developer Challenge ● A developer challenge Google hold every year for Android mobile platform ● Demonstrates the capabilities of Android platform ● Developers submit their apps to one of 10 specially-designated ADC categories ● Top 20 applications in each category will proceed to the second round ● Community vote constituting 40% of the final judging score
  • 25. Vladimir Kotov Android Internals and Toolchain 25 Accessory Development Kit ● RI for building accessories for Android ● Source code and hardware specifications ● ADK 2012 is based on the Arduino open source electronics prototyping platform
  • 26. Install Android What do we need for Android? • Android SDK • ADT (Android Developer Tools) • AVD (Android Virtual Device)
  • 27. Vladimir Kotov Android Internals and Toolchain 27 Android SDK ● Android APIs Developer access to the Android stack ● Development tools Compile and debug your applications ● Android Virtual Device Manager ● Emulator ● Documentation ● Sample code
  • 28. Vladimir Kotov Android Internals and Toolchain 28 Android SDK ● http://developer.android.com/sdk (Linux, Mac OS X, Windows) ● Installation Option1: SDK Tools Only ● Initially contains only the basic SDK tools ● Need to install the Platform-tools and Android platform(s) ● Installation Option2: ADT Bundle ● Eclipse + ADT plugin ● Android SDK Tools ● Android Platform-tools ● The latest Android platform ● The latest Android system image for the emulator
  • 29. Vladimir Kotov Android Internals and Toolchain 29 Android SDK SDK Manager.exe (Windows) v. tools/android (Mac, Linux)
  • 30. Vladimir Kotov Android Internals and Toolchain 30 Android SDK SDK packages <sdk>/tools/ Tools for debugging and testing, utilities to develop an app (sdk manager, ddms, emulator) <sdk>/platform- tools/ Platform-dependent tools for developing, support latest features of the Android platform and are updated with new platform (adb, fastboot, aapt) <sdk>/docs/ <sdk>/sources/ Latest documentation for the Android APIs <sdk>/platforms/ a) SDK Platform for each version of Android, android.jar with a fully compliant Android library b) System images for Android emulator <sdk>/add-ons/ <sdk>/extras/ Special APIs and static libraries you can include in your app sources in order to use powerful APIs that aren't available in the standard platform
  • 31. Vladimir Kotov Android Internals and Toolchain 31 Android Development Tools ● Eclipse plugin ● Professional-grade development environment ● Free, open-source, and runs on most major OS ● Provides the emulator
  • 32. Vladimir Kotov Android Internals and Toolchain 32 Android Development Tools ● Tooling ● Wizard for creating new project ● WYSWYG UI Designer ● Code / XML editor ● Integrated with ● AVD Manager ● DDMS
  • 33. Vladimir Kotov Android Internals and Toolchain 33 ADT Installation Options ● ADT Bundle provides everything you need to start - Eclipse IDE with built-in ADT Eclipse Juno Release ● Existing IDE Download ADT plugin – Help > Install New Software. – Add Repository https://dl-ssl.google.com/android/eclipse/ Configure ADT plugin
  • 34. Vladimir Kotov Android Internals and Toolchain 34 Android Emulator ● QEMU-based ● Same image as on device ● Same toolchain to work with device or emulator ● Mimics all of the hardware and software features of a typical mobile device ● Startup may be slow, try “Graphics Acceleration” and “Virtual Machine Acceleration”, or use a device instead
  • 35. Vladimir Kotov Android Internals and Toolchain 35 Android Virtual Device ● Android Virtual Device (AVD) is an emulator configuration to model an actual device by defining hardware and software options ● Hardware profile - hardware features (camera, physical, memory) ● Mapping to a system image - version of the Android platform will run on the virtual device ● Dedicated storage area - the device's user data, emulated SD card ● Other options - emulator skin, emulated SD card
  • 36. Vladimir Kotov Android Internals and Toolchain 36 Develop on Hardware Devices ● Use any Android hardware device ● Deploy your app to connected devices directy from the IDE ● Live, on-device debugging, testing, and profiling ● Enable debugging over USB ● Developer options in the system Settings
  • 37. Vladimir Kotov Android Internals and Toolchain 37 Dalvik Debug Monitor Server (DDMS) ● Works with both the emulator and a connected device ● Capabilities ● Heap usage for a process ● Track memory allocation of objects ● Work with an emulator or device's file system ● Examining thread information ● Network Traffic tool (Android 4.0) ● LogCat
  • 38. Vladimir Kotov Android Internals and Toolchain 38 DEMO
  • 39. Vladimir Kotov Android Internals and Toolchain 39 Usefull SDK utilities Android Debug Bridge (adb) Command line tool to communicate with an emulator instance or device (client, server, daemon) Important commands: - devices – show device list - install – install application file - pull / push – copy files to/from device - logcat - print log data - shell – start remote shell on device Android Device Monitor (monitor) Tool for Android application debugging and analysis without ADT Hierarchy Viewer (hierarchyviewer) Debug and optimize your user interface. Visual representation of the layout's View hierarchy ProGuard Obfuscates your code
  • 40. Vladimir Kotov Android Internals and Toolchain 40 Native development kit (NDK) ● Tools to build and compile your native code for the device architecture ● A way to package your library into the APK file to distribute your application easily ● A set of native system headers supported for Android platform (libc, libz, liblog, JNI headers) ● Documentation, samples If the speed and efficiency of C/C++ is required
  • 41. Vladimir Kotov Android Internals and Toolchain 41 Application creation cycle
  • 42. Vladimir Kotov Android Internals and Toolchain 42 Hello, world ... finally DEMO