SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
Android	
  
 Internals	
  


Marko	
  Gargenta	
  
  Marakana	
  
Agenda	
  
•    Android	
  Stack	
  
•    Opera6ng	
  System	
  Features	
  
•    Working	
  with	
  Hardware	
  
•    Android	
  Startup	
  &	
  Run6me	
  
•    Na6ve	
  Development	
  Kit	
  
•    Debugging	
  
•    Summary	
  
ANDROID	
  STACK	
  
The	
  Stack	
  
Linux	
  Kernel	
  
Android runs on Linux.                                        Applications


                                    Home      Contacts          Phone             Browser              Other

Linux provides as well as:
    Hardware abstraction layer                            Application Framework
    Memory management              Activity        Window                    Content                   View

    Process management
                                   Manager         Manager                  Providers                 System

                                   Package    Telephony         Resource           Location            Notiication
    Networking                     Manager     Manager          Manager            Manager             Manager


                                                                Libraries
Users never see Linux sub system   Surface       Media
                                                                   SQLite                  Android Runtime
                                   Manager     Framework

                                                                                                 Core Libs

The adb shell command opens        OpenGL      FreeType            WebKit

                                                                                                  Delvik
Linux shell                          SGL          SSL               libc
                                                                                                   VM




                                    Display    Camera         Linux Kernel              Flash                Binder
                                    Driver      Driver                                  Driver               Driver

                                    Keypad      WiFi                                    Audio                Power
                                     Driver     Driver                                  Driver               Mgmt
Na6ve	
  Libraries	
  
Bionic, a super fast and small                                Applications


GPL-based libc library optimized    Home      Contacts          Phone             Browser              Other

for embedded use
                                                          Application Framework
Surface Manager for composing      Activity        Window                    Content                   View

window manager with off-screen     Manager         Manager                  Providers                 System


buffering
                                   Package    Telephony         Resource           Location            Notiication
                                   Manager     Manager          Manager            Manager             Manager


                                                                Libraries
2D and 3D graphics hardware        Surface       Media
                                                                   SQLite                  Android Runtime
support or software simulation
                                   Manager     Framework

                                                                                                 Core Libs
                                   OpenGL      FreeType            WebKit

                                                                                                  Delvik
Media codecs offer support for       SGL          SSL               libc
                                                                                                   VM

major audio/video codecs
                                    Display    Camera         Linux Kernel              Flash                Binder
                                                                                        Driver               Driver
SQLite database
                                    Driver      Driver

                                    Keypad      WiFi                                    Audio                Power
                                     Driver     Driver                                  Driver               Mgmt


WebKit library for fast HTML
rendering
Dalvik	
  
Dalvik VM is Google’s implementation of Java

Optimized for mobile devices




Key Dalvik differences:

    Register-based versus stack-based VM
    Dalvik runs .dex files
    More efficient and compact implementation
    Different set of Java libraries than SDK
Android	
  and	
  Java	
  
Applica6on	
  Framework	
  
Activation manager controls the life                              Applications


cycle of the app                        Home      Contacts          Phone             Browser              Other




Content providers encapsulate data                            Application Framework
that is shared (e.g. contacts)         Activity        Window                    Content                   View
                                       Manager         Manager                  Providers                 System

                                       Package    Telephony         Resource           Location            Notiication
Resource manager manages               Manager     Manager          Manager            Manager             Manager


everything that is not the code                                     Libraries
                                       Surface       Media
                                                                       SQLite                  Android Runtime
                                       Manager     Framework

Location manager figures out the                                                                     Core Libs

location of the phone (GPS, GSM,
                                       OpenGL      FreeType            WebKit

                                                                                                      Delvik

WiFi)                                    SGL          SSL               libc
                                                                                                       VM




Notification manager for events         Display
                                        Driver
                                                   Camera
                                                    Driver
                                                                  Linux Kernel              Flash
                                                                                            Driver
                                                                                                                 Binder
                                                                                                                 Driver

such as arriving messages,              Keypad      WiFi                                    Audio
                                                                                            Driver
                                                                                                                 Power
                                                                                                                 Mgmt
                                         Driver     Driver
appointments, etc
Applica6ons	
  
OPERATING	
  SYSTEM	
  FEATURES	
  	
  
File	
  System	
  
The file system has three main mount points. One
for system, one for the apps, and one for whatever.

Each app has its own sandbox easily accessible to
it. No one else can access its data. The sandbox is
in /data/data/com.marakana/

SDCard is expected to always be there. It’s a good
place for large files, such as movies and music.
Everyone can access it.
Security	
  
Each Android application            Android Application
runs inside its own Linux
process.                                     Linux Process
Additionally, each application
has its own sandbox file                                   File
system with its own set of                     Prefs
                                       DB                 System
preferences and its own
database.

Other applications cannot
access any of its data,
unless it is explicitly shared.
WORKING	
  WITH	
  HARDWARE	
  
Camera	
  
Android SDK supports access to
built-in Camera and its preview.

You can access real-time frames,
or get a callback when shutter is
open. The photo data is passed
back in either raw or jpeg format.
WiFi
                                      	
  
WiFi API allows for managing your
connection, scanning for active WiFi
points and find out details about each.
Telephony
                                     	
  
With Telephony API, you can:

Make phone calls
Monitor phone state and activity
Access phone properties and status
Monitor data connectivity
Control the phone

It is a simple yet powerful API
ANDROID	
  	
  
STARTUP	
  &	
  	
  
RUNTIME	
  
Startup	
  Walkthrough	
  
Run6me	
  Overview	
  
Layer	
  Interac6ons
                                     	
  
There are three main
scenarios for your app to talk
to native library:

-  Directly
-  Via native service
-  Via native daemon

It will depend on the type of
app and type of native library
which method works best.
App	
  –	
  Run6me	
  Service	
  -­‐	
  Lib	
  
App	
  –	
  Run6me-­‐Na6ve	
  Service-­‐Lib	
  
App–Run6me–Na6ve	
  Daemon-­‐Lib	
  
Binder	
  IPC	
  




High-performance IPC: shared memory, per-process thread pool, synchronous
Java	
  Na6ve	
  Interface	
  

JNI defines naming and coding
convention so that Java VM can find
and call native code.

JNI is built into JVM to provide
access to OS I/O and others.
Building	
  and	
  Running	
  JNI	
  Code	
  
NATIVE	
  
DEVELOPMENT	
  
KIT	
  
What’s	
  in	
  NDK?	
  
Tools to build and compile your native code for the device
architecture (such as ARM)


A way to package your library into the APK file so you can
distribute your application easily


A set of native system headers that will be supported for
the future releases of Android platform (libc, libm, libz,
liblog, JNI headers, some C++ headers, and OpenGL)



(some) documentation, sample code and examples
Why	
  NDK?	
  

NDK allows you to develop parts of your Android
application in C/C++.

You cannot develop native-only apps in NDK –
your app is still subject to security sandboxing.

Main motivation for native code is performance.
Using	
  NDK	
  
DEBUGGING	
  	
  
ANDROID	
  APPS	
  
LogCat
                              	
  
The universal, most
versatile way to track
what is going on in
your app.

Can be viewed via
command line or
Eclipse.

Logs can be
generated both from
SDK Java code, or
low-level C code via
Bionic libc extension.
Debugger
                                    	
  




Your standard debugger is included in SDK, with all the usual bells & whistles.
TraceView	
  




TraceView helps you profile you application and find bottlenecks. It shows
execution of various calls through the entire stack. You can zoom into specific
calls.
Hierarchy	
  Viewer
                                          	
  
Hierarchy Viewer helps
you analyze your User
Interface.

Base UI tends to be the
most “expensive” part of
your application, this tool
is very useful.
Summary	
  
     For most applications, you will just
     need Android SDK to develop apps.

     Sometimes you may need NDK to
     make parts of your app run faster.

     Ultimately, you can do whatever you
     want by compiling Android platform
     from source.



     Marko Gargenta
     Marakana.com



     Licensed under Creative Commons
     License (cc-by-nc-nd). Please Share!

Contenu connexe

Tendances

An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To AndroidGoogleTecTalks
 
Android Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar GargentaAndroid Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar GargentaMarakana Inc.
 
The anatomy and philosophy of Android - Google I/O 2009
The anatomy and philosophy of Android - Google I/O 2009The anatomy and philosophy of Android - Google I/O 2009
The anatomy and philosophy of Android - Google I/O 2009Viswanath J
 
Android Beyond The Phone
Android Beyond The PhoneAndroid Beyond The Phone
Android Beyond The PhoneMarko Gargenta
 
Tacademy techclinic-2012-07-11
Tacademy techclinic-2012-07-11Tacademy techclinic-2012-07-11
Tacademy techclinic-2012-07-11영호 라
 
Droid con berlin_the_bb10_android_runtime
Droid con berlin_the_bb10_android_runtimeDroid con berlin_the_bb10_android_runtime
Droid con berlin_the_bb10_android_runtimeDroidcon Berlin
 
Introduction To Android
Introduction To AndroidIntroduction To Android
Introduction To Androidma-polimi
 
Systems Resource Management with NetIQ AppManager
Systems Resource Management with NetIQ AppManagerSystems Resource Management with NetIQ AppManager
Systems Resource Management with NetIQ AppManagerAdvanced Logic Industries
 
Webinar The App Lifecycle Platform
Webinar The App Lifecycle PlatformWebinar The App Lifecycle Platform
Webinar The App Lifecycle PlatformService2Media
 
Accelerate your PaaS to the Mobile World: Silicon Valley Code Camp 2012
Accelerate your PaaS to the Mobile World: Silicon Valley Code Camp 2012Accelerate your PaaS to the Mobile World: Silicon Valley Code Camp 2012
Accelerate your PaaS to the Mobile World: Silicon Valley Code Camp 2012CloudBees
 
Android unveiled (I)
Android unveiled (I)Android unveiled (I)
Android unveiled (I)denian00
 
Codendi Datasheet
Codendi DatasheetCodendi Datasheet
Codendi DatasheetCodendi
 
Open Source Licenses and Tools
Open Source Licenses and ToolsOpen Source Licenses and Tools
Open Source Licenses and Toolsg2ix
 
Mee go是您的新机遇
Mee go是您的新机遇Mee go是您的新机遇
Mee go是您的新机遇OpenSourceCamp
 
Android : How Do I Code Thee?
Android : How Do I Code Thee?Android : How Do I Code Thee?
Android : How Do I Code Thee?Viswanath J
 
Android architecture
Android architectureAndroid architecture
Android architectureHari Krishna
 
Develop Ruby Applications Fast | TubroRuby
Develop Ruby Applications Fast | TubroRubyDevelop Ruby Applications Fast | TubroRuby
Develop Ruby Applications Fast | TubroRubyMichael Findling
 
Framework Engineering
Framework EngineeringFramework Engineering
Framework EngineeringYoungSu Son
 

Tendances (19)

Android Internals
Android InternalsAndroid Internals
Android Internals
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
Android Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar GargentaAndroid Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar Gargenta
 
The anatomy and philosophy of Android - Google I/O 2009
The anatomy and philosophy of Android - Google I/O 2009The anatomy and philosophy of Android - Google I/O 2009
The anatomy and philosophy of Android - Google I/O 2009
 
Android Beyond The Phone
Android Beyond The PhoneAndroid Beyond The Phone
Android Beyond The Phone
 
Tacademy techclinic-2012-07-11
Tacademy techclinic-2012-07-11Tacademy techclinic-2012-07-11
Tacademy techclinic-2012-07-11
 
Droid con berlin_the_bb10_android_runtime
Droid con berlin_the_bb10_android_runtimeDroid con berlin_the_bb10_android_runtime
Droid con berlin_the_bb10_android_runtime
 
Introduction To Android
Introduction To AndroidIntroduction To Android
Introduction To Android
 
Systems Resource Management with NetIQ AppManager
Systems Resource Management with NetIQ AppManagerSystems Resource Management with NetIQ AppManager
Systems Resource Management with NetIQ AppManager
 
Webinar The App Lifecycle Platform
Webinar The App Lifecycle PlatformWebinar The App Lifecycle Platform
Webinar The App Lifecycle Platform
 
Accelerate your PaaS to the Mobile World: Silicon Valley Code Camp 2012
Accelerate your PaaS to the Mobile World: Silicon Valley Code Camp 2012Accelerate your PaaS to the Mobile World: Silicon Valley Code Camp 2012
Accelerate your PaaS to the Mobile World: Silicon Valley Code Camp 2012
 
Android unveiled (I)
Android unveiled (I)Android unveiled (I)
Android unveiled (I)
 
Codendi Datasheet
Codendi DatasheetCodendi Datasheet
Codendi Datasheet
 
Open Source Licenses and Tools
Open Source Licenses and ToolsOpen Source Licenses and Tools
Open Source Licenses and Tools
 
Mee go是您的新机遇
Mee go是您的新机遇Mee go是您的新机遇
Mee go是您的新机遇
 
Android : How Do I Code Thee?
Android : How Do I Code Thee?Android : How Do I Code Thee?
Android : How Do I Code Thee?
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
Develop Ruby Applications Fast | TubroRuby
Develop Ruby Applications Fast | TubroRubyDevelop Ruby Applications Fast | TubroRuby
Develop Ruby Applications Fast | TubroRuby
 
Framework Engineering
Framework EngineeringFramework Engineering
Framework Engineering
 

En vedette

Titus Salt School Presentation
Titus Salt School PresentationTitus Salt School Presentation
Titus Salt School Presentationmaxjrobinson
 
CaracteríStiques Alumnat Nouvingut Revisat
CaracteríStiques Alumnat Nouvingut RevisatCaracteríStiques Alumnat Nouvingut Revisat
CaracteríStiques Alumnat Nouvingut RevisatArnau Cerdà
 
SOFTORIX Project TitlesList
SOFTORIX Project TitlesListSOFTORIX Project TitlesList
SOFTORIX Project TitlesListguest6071d14
 
GIZAKION ETA INGURUNEAREN ARTEKO HARREMANA
GIZAKION ETA INGURUNEAREN ARTEKO HARREMANAGIZAKION ETA INGURUNEAREN ARTEKO HARREMANA
GIZAKION ETA INGURUNEAREN ARTEKO HARREMANAF. J. Zumarraga
 
Property for Sale 46 Meeanee Quay
Property for Sale 46 Meeanee QuayProperty for Sale 46 Meeanee Quay
Property for Sale 46 Meeanee Quayrobventer
 
Miksi kansainvälistymään ? Mistä kumppani ja rahaa?
Miksi kansainvälistymään ? Mistä kumppani ja rahaa?Miksi kansainvälistymään ? Mistä kumppani ja rahaa?
Miksi kansainvälistymään ? Mistä kumppani ja rahaa?Pasi Siltakorpi
 
Gianfranco Burzio (CRF), a subjective Field Test on Lane Departure Warning Fu...
Gianfranco Burzio (CRF), a subjective Field Test on Lane Departure Warning Fu...Gianfranco Burzio (CRF), a subjective Field Test on Lane Departure Warning Fu...
Gianfranco Burzio (CRF), a subjective Field Test on Lane Departure Warning Fu...euroFOT
 
Ict In Elt Class Project 4wiziq
Ict In Elt   Class Project 4wiziqIct In Elt   Class Project 4wiziq
Ict In Elt Class Project 4wiziqJesús Bastidas
 
Aria Etemad, Ford, euroFOT: European large-scale Field Operational Test on Ac...
Aria Etemad, Ford, euroFOT: European large-scale Field Operational Test on Ac...Aria Etemad, Ford, euroFOT: European large-scale Field Operational Test on Ac...
Aria Etemad, Ford, euroFOT: European large-scale Field Operational Test on Ac...euroFOT
 
Wallets Collection
Wallets CollectionWallets Collection
Wallets Collectionkausarh
 
New Generation Of Greek Female Youth
New Generation Of Greek Female YouthNew Generation Of Greek Female Youth
New Generation Of Greek Female Youthguest8f1995
 
Downregulation Van Groeifactorsignaaltransductie2009 Deel2
Downregulation Van Groeifactorsignaaltransductie2009 Deel2Downregulation Van Groeifactorsignaaltransductie2009 Deel2
Downregulation Van Groeifactorsignaaltransductie2009 Deel2BMW, Utrecht University
 

En vedette (20)

Titus Salt School Presentation
Titus Salt School PresentationTitus Salt School Presentation
Titus Salt School Presentation
 
News
NewsNews
News
 
CaracteríStiques Alumnat Nouvingut Revisat
CaracteríStiques Alumnat Nouvingut RevisatCaracteríStiques Alumnat Nouvingut Revisat
CaracteríStiques Alumnat Nouvingut Revisat
 
SOFTORIX Project TitlesList
SOFTORIX Project TitlesListSOFTORIX Project TitlesList
SOFTORIX Project TitlesList
 
Poison Center Services 2008
Poison Center Services 2008Poison Center Services 2008
Poison Center Services 2008
 
GIZAKION ETA INGURUNEAREN ARTEKO HARREMANA
GIZAKION ETA INGURUNEAREN ARTEKO HARREMANAGIZAKION ETA INGURUNEAREN ARTEKO HARREMANA
GIZAKION ETA INGURUNEAREN ARTEKO HARREMANA
 
Property for Sale 46 Meeanee Quay
Property for Sale 46 Meeanee QuayProperty for Sale 46 Meeanee Quay
Property for Sale 46 Meeanee Quay
 
Miksi kansainvälistymään ? Mistä kumppani ja rahaa?
Miksi kansainvälistymään ? Mistä kumppani ja rahaa?Miksi kansainvälistymään ? Mistä kumppani ja rahaa?
Miksi kansainvälistymään ? Mistä kumppani ja rahaa?
 
Gianfranco Burzio (CRF), a subjective Field Test on Lane Departure Warning Fu...
Gianfranco Burzio (CRF), a subjective Field Test on Lane Departure Warning Fu...Gianfranco Burzio (CRF), a subjective Field Test on Lane Departure Warning Fu...
Gianfranco Burzio (CRF), a subjective Field Test on Lane Departure Warning Fu...
 
Taiwan2009
Taiwan2009Taiwan2009
Taiwan2009
 
Ict In Elt Class Project 4wiziq
Ict In Elt   Class Project 4wiziqIct In Elt   Class Project 4wiziq
Ict In Elt Class Project 4wiziq
 
Iss
IssIss
Iss
 
Dominique's Project
Dominique's ProjectDominique's Project
Dominique's Project
 
Aria Etemad, Ford, euroFOT: European large-scale Field Operational Test on Ac...
Aria Etemad, Ford, euroFOT: European large-scale Field Operational Test on Ac...Aria Etemad, Ford, euroFOT: European large-scale Field Operational Test on Ac...
Aria Etemad, Ford, euroFOT: European large-scale Field Operational Test on Ac...
 
Nokia
NokiaNokia
Nokia
 
Page Rank
Page RankPage Rank
Page Rank
 
Wallets Collection
Wallets CollectionWallets Collection
Wallets Collection
 
New Generation Of Greek Female Youth
New Generation Of Greek Female YouthNew Generation Of Greek Female Youth
New Generation Of Greek Female Youth
 
Trends in human mobility
Trends in human mobility Trends in human mobility
Trends in human mobility
 
Downregulation Van Groeifactorsignaaltransductie2009 Deel2
Downregulation Van Groeifactorsignaaltransductie2009 Deel2Downregulation Van Groeifactorsignaaltransductie2009 Deel2
Downregulation Van Groeifactorsignaaltransductie2009 Deel2
 

Similaire à Android Internals

Google Io Introduction To Android
Google Io Introduction To AndroidGoogle Io Introduction To Android
Google Io Introduction To AndroidBhavya Siddappa
 
Inside Android's Dalvik VM - NEJUG Nov 2011
Inside Android's Dalvik VM - NEJUG Nov 2011Inside Android's Dalvik VM - NEJUG Nov 2011
Inside Android's Dalvik VM - NEJUG Nov 2011Doug Hawkins
 
Android application development
Android application developmentAndroid application development
Android application developmentLinh Vi Tường
 
Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012Agora Group
 
Google Android Naver 1212
Google Android Naver 1212Google Android Naver 1212
Google Android Naver 1212Yoojoo Jang
 
Multithreading in Android
Multithreading in AndroidMultithreading in Android
Multithreading in Androidcoolmirza143
 
Introduction to Android platform
Introduction to Android platformIntroduction to Android platform
Introduction to Android platformmaamir farooq
 
How to Choose the Right API Management Solution
How to Choose the Right API Management SolutionHow to Choose the Right API Management Solution
How to Choose the Right API Management SolutionCA API Management
 
Slides bootcamp21
Slides bootcamp21Slides bootcamp21
Slides bootcamp21dxsaki
 
Cross Platform Mobile Apps with APIs from Qcon San Francisco
Cross Platform Mobile Apps with APIs from Qcon San FranciscoCross Platform Mobile Apps with APIs from Qcon San Francisco
Cross Platform Mobile Apps with APIs from Qcon San FranciscoCA API Management
 
Lecture slides introduction_introduction
Lecture slides introduction_introductionLecture slides introduction_introduction
Lecture slides introduction_introductionBadr Benali
 
Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android SecurityMarakana Inc.
 
Cloud Intelligence - Build a Private Cloud in a 1,000 Easy Steps
Cloud Intelligence - Build a Private Cloud in a 1,000 Easy StepsCloud Intelligence - Build a Private Cloud in a 1,000 Easy Steps
Cloud Intelligence - Build a Private Cloud in a 1,000 Easy StepsHarold Wong
 
Windows Phone 7.5 와 Windows 8 메트로 스타일 앱 개발
Windows Phone 7.5  와 Windows 8 메트로 스타일 앱 개발Windows Phone 7.5  와 Windows 8 메트로 스타일 앱 개발
Windows Phone 7.5 와 Windows 8 메트로 스타일 앱 개발Seo Jinho
 
2011 android
2011 android2011 android
2011 androidvpedapolu
 
Soa204 Kawasaki Final
Soa204 Kawasaki FinalSoa204 Kawasaki Final
Soa204 Kawasaki FinalAnush Kumar
 
The role of hyper-v in nist model
The role of hyper-v in nist modelThe role of hyper-v in nist model
The role of hyper-v in nist modelAlexey Bokov
 
What’s new in windows server 2012
What’s new in windows server 2012What’s new in windows server 2012
What’s new in windows server 2012Alex de Jong
 

Similaire à Android Internals (20)

Google Io Introduction To Android
Google Io Introduction To AndroidGoogle Io Introduction To Android
Google Io Introduction To Android
 
Android and Intel Inside
Android and Intel InsideAndroid and Intel Inside
Android and Intel Inside
 
Inside Android's Dalvik VM - NEJUG Nov 2011
Inside Android's Dalvik VM - NEJUG Nov 2011Inside Android's Dalvik VM - NEJUG Nov 2011
Inside Android's Dalvik VM - NEJUG Nov 2011
 
Android application development
Android application developmentAndroid application development
Android application development
 
Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012
 
Google Android Naver 1212
Google Android Naver 1212Google Android Naver 1212
Google Android Naver 1212
 
Multithreading in Android
Multithreading in AndroidMultithreading in Android
Multithreading in Android
 
Introduction to Android platform
Introduction to Android platformIntroduction to Android platform
Introduction to Android platform
 
How to Choose the Right API Management Solution
How to Choose the Right API Management SolutionHow to Choose the Right API Management Solution
How to Choose the Right API Management Solution
 
Slides bootcamp21
Slides bootcamp21Slides bootcamp21
Slides bootcamp21
 
Cross Platform Mobile Apps with APIs from Qcon San Francisco
Cross Platform Mobile Apps with APIs from Qcon San FranciscoCross Platform Mobile Apps with APIs from Qcon San Francisco
Cross Platform Mobile Apps with APIs from Qcon San Francisco
 
Improve Android System Component Performance
Improve Android System Component PerformanceImprove Android System Component Performance
Improve Android System Component Performance
 
Lecture slides introduction_introduction
Lecture slides introduction_introductionLecture slides introduction_introduction
Lecture slides introduction_introduction
 
Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android Security
 
Cloud Intelligence - Build a Private Cloud in a 1,000 Easy Steps
Cloud Intelligence - Build a Private Cloud in a 1,000 Easy StepsCloud Intelligence - Build a Private Cloud in a 1,000 Easy Steps
Cloud Intelligence - Build a Private Cloud in a 1,000 Easy Steps
 
Windows Phone 7.5 와 Windows 8 메트로 스타일 앱 개발
Windows Phone 7.5  와 Windows 8 메트로 스타일 앱 개발Windows Phone 7.5  와 Windows 8 메트로 스타일 앱 개발
Windows Phone 7.5 와 Windows 8 메트로 스타일 앱 개발
 
2011 android
2011 android2011 android
2011 android
 
Soa204 Kawasaki Final
Soa204 Kawasaki FinalSoa204 Kawasaki Final
Soa204 Kawasaki Final
 
The role of hyper-v in nist model
The role of hyper-v in nist modelThe role of hyper-v in nist model
The role of hyper-v in nist model
 
What’s new in windows server 2012
What’s new in windows server 2012What’s new in windows server 2012
What’s new in windows server 2012
 

Plus de Marko Gargenta

LTE: Building New Killer Apps
LTE: Building New Killer AppsLTE: Building New Killer Apps
LTE: Building New Killer AppsMarko Gargenta
 
Marakana Android User Interface
Marakana Android User InterfaceMarakana Android User Interface
Marakana Android User InterfaceMarko Gargenta
 
Marakana android-java developers
Marakana android-java developersMarakana android-java developers
Marakana android-java developersMarko Gargenta
 
Why Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, MarakanaWhy Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, MarakanaMarko Gargenta
 
Jens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardJens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardMarko Gargenta
 
Jens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardJens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardMarko Gargenta
 

Plus de Marko Gargenta (8)

LTE: Building New Killer Apps
LTE: Building New Killer AppsLTE: Building New Killer Apps
LTE: Building New Killer Apps
 
Java Champion Wanted
Java Champion WantedJava Champion Wanted
Java Champion Wanted
 
Marakana Android User Interface
Marakana Android User InterfaceMarakana Android User Interface
Marakana Android User Interface
 
Marakana android-java developers
Marakana android-java developersMarakana android-java developers
Marakana android-java developers
 
Scrum Overview
Scrum OverviewScrum Overview
Scrum Overview
 
Why Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, MarakanaWhy Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, Marakana
 
Jens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardJens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So Hard
 
Jens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardJens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So Hard
 

Dernier

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 

Dernier (20)

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 

Android Internals

  • 1. Android   Internals   Marko  Gargenta   Marakana  
  • 2. Agenda   •  Android  Stack   •  Opera6ng  System  Features   •  Working  with  Hardware   •  Android  Startup  &  Run6me   •  Na6ve  Development  Kit   •  Debugging   •  Summary  
  • 5. Linux  Kernel   Android runs on Linux. Applications Home Contacts Phone Browser Other Linux provides as well as: Hardware abstraction layer Application Framework Memory management Activity Window Content View Process management Manager Manager Providers System Package Telephony Resource Location Notiication Networking Manager Manager Manager Manager Manager Libraries Users never see Linux sub system Surface Media SQLite Android Runtime Manager Framework Core Libs The adb shell command opens OpenGL FreeType WebKit Delvik Linux shell SGL SSL libc VM Display Camera Linux Kernel Flash Binder Driver Driver Driver Driver Keypad WiFi Audio Power Driver Driver Driver Mgmt
  • 6. Na6ve  Libraries   Bionic, a super fast and small Applications GPL-based libc library optimized Home Contacts Phone Browser Other for embedded use Application Framework Surface Manager for composing Activity Window Content View window manager with off-screen Manager Manager Providers System buffering Package Telephony Resource Location Notiication Manager Manager Manager Manager Manager Libraries 2D and 3D graphics hardware Surface Media SQLite Android Runtime support or software simulation Manager Framework Core Libs OpenGL FreeType WebKit Delvik Media codecs offer support for SGL SSL libc VM major audio/video codecs Display Camera Linux Kernel Flash Binder Driver Driver SQLite database Driver Driver Keypad WiFi Audio Power Driver Driver Driver Mgmt WebKit library for fast HTML rendering
  • 7. Dalvik   Dalvik VM is Google’s implementation of Java Optimized for mobile devices Key Dalvik differences: Register-based versus stack-based VM Dalvik runs .dex files More efficient and compact implementation Different set of Java libraries than SDK
  • 9. Applica6on  Framework   Activation manager controls the life Applications cycle of the app Home Contacts Phone Browser Other Content providers encapsulate data Application Framework that is shared (e.g. contacts) Activity Window Content View Manager Manager Providers System Package Telephony Resource Location Notiication Resource manager manages Manager Manager Manager Manager Manager everything that is not the code Libraries Surface Media SQLite Android Runtime Manager Framework Location manager figures out the Core Libs location of the phone (GPS, GSM, OpenGL FreeType WebKit Delvik WiFi) SGL SSL libc VM Notification manager for events Display Driver Camera Driver Linux Kernel Flash Driver Binder Driver such as arriving messages, Keypad WiFi Audio Driver Power Mgmt Driver Driver appointments, etc
  • 12. File  System   The file system has three main mount points. One for system, one for the apps, and one for whatever. Each app has its own sandbox easily accessible to it. No one else can access its data. The sandbox is in /data/data/com.marakana/ SDCard is expected to always be there. It’s a good place for large files, such as movies and music. Everyone can access it.
  • 13. Security   Each Android application Android Application runs inside its own Linux process. Linux Process Additionally, each application has its own sandbox file File system with its own set of Prefs DB System preferences and its own database. Other applications cannot access any of its data, unless it is explicitly shared.
  • 15. Camera   Android SDK supports access to built-in Camera and its preview. You can access real-time frames, or get a callback when shutter is open. The photo data is passed back in either raw or jpeg format.
  • 16. WiFi   WiFi API allows for managing your connection, scanning for active WiFi points and find out details about each.
  • 17. Telephony   With Telephony API, you can: Make phone calls Monitor phone state and activity Access phone properties and status Monitor data connectivity Control the phone It is a simple yet powerful API
  • 18. ANDROID     STARTUP  &     RUNTIME  
  • 21. Layer  Interac6ons   There are three main scenarios for your app to talk to native library: -  Directly -  Via native service -  Via native daemon It will depend on the type of app and type of native library which method works best.
  • 22. App  –  Run6me  Service  -­‐  Lib  
  • 23. App  –  Run6me-­‐Na6ve  Service-­‐Lib  
  • 25. Binder  IPC   High-performance IPC: shared memory, per-process thread pool, synchronous
  • 26. Java  Na6ve  Interface   JNI defines naming and coding convention so that Java VM can find and call native code. JNI is built into JVM to provide access to OS I/O and others.
  • 27. Building  and  Running  JNI  Code  
  • 29. What’s  in  NDK?   Tools to build and compile your native code for the device architecture (such as ARM) A way to package your library into the APK file so you can distribute your application easily A set of native system headers that will be supported for the future releases of Android platform (libc, libm, libz, liblog, JNI headers, some C++ headers, and OpenGL) (some) documentation, sample code and examples
  • 30. Why  NDK?   NDK allows you to develop parts of your Android application in C/C++. You cannot develop native-only apps in NDK – your app is still subject to security sandboxing. Main motivation for native code is performance.
  • 33. LogCat   The universal, most versatile way to track what is going on in your app. Can be viewed via command line or Eclipse. Logs can be generated both from SDK Java code, or low-level C code via Bionic libc extension.
  • 34. Debugger   Your standard debugger is included in SDK, with all the usual bells & whistles.
  • 35. TraceView   TraceView helps you profile you application and find bottlenecks. It shows execution of various calls through the entire stack. You can zoom into specific calls.
  • 36. Hierarchy  Viewer   Hierarchy Viewer helps you analyze your User Interface. Base UI tends to be the most “expensive” part of your application, this tool is very useful.
  • 37. Summary   For most applications, you will just need Android SDK to develop apps. Sometimes you may need NDK to make parts of your app run faster. Ultimately, you can do whatever you want by compiling Android platform from source. Marko Gargenta Marakana.com Licensed under Creative Commons License (cc-by-nc-nd). Please Share!