![Page 1: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/1.jpg)
Introduction to AndroidLecture 1
Android Native Development Kit
9 February 2014
NDK Introduction to Android, Lecture 1 1/30
![Page 2: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/2.jpg)
Rules and Grading
Android Architecture
Application components
IPC
Tools
Keywords
NDK Introduction to Android, Lecture 1 2/30
![Page 3: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/3.jpg)
Outline
Rules and Grading
Android Architecture
Application components
IPC
Tools
Keywords
NDK Introduction to Android, Lecture 1 3/30
![Page 4: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/4.jpg)
Rules and Grading
I Petre Eftime & Laura Gheorghe
I Course and lab: 17:00 - 20:00, Tuesdays
I Project: 20:00 - 21:00, TuesdaysI Grading
I 10% lecture and lab activityI 10% assignmentI 40% projectI 40% final examI 10% bonus for feedback
NDK Introduction to Android, Lecture 1 4/30
![Page 5: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/5.jpg)
Outline
Rules and Grading
Android Architecture
Application components
IPC
Tools
Keywords
NDK Introduction to Android, Lecture 1 5/30
![Page 6: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/6.jpg)
Android Architecture
Source: http://commons.wikimedia.org
NDK Introduction to Android, Lecture 1 6/30
![Page 7: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/7.jpg)
Android Architecture
I Linux kernelI AOSP
I RuntimeI LibrariesI Application framework
I Applications
NDK Introduction to Android, Lecture 1 7/30
![Page 8: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/8.jpg)
Linux kernel
I Patches on top of mainline Linux
I Android Mainlining Project
I Wakelocks (also added to Linux 3.5)
I Low-Memory Killer, Binder, Alarm, Logger, etc.
I Only suspend to memory
NDK Introduction to Android, Lecture 1 8/30
![Page 9: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/9.jpg)
Android Runtime
I Dalvik Virtual Machine (Java VM)
I Runs Dalvik-specific byte-code generated from Java-basedapps, system components
I Apache Harmony project (implementation of Java libraries)
I Designed for embedded systems (slow CPU, small RAM, noswap, battery)
I Works with .dex files instead of .jar filesI Dalvik Executable FormatI .dex is 50% smaller than corresponding .jar
NDK Introduction to Android, Lecture 1 9/30
![Page 10: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/10.jpg)
Android Runtime
. . .
Class1.java
Class2.java
ClassN.java
. . .
Class1.classconstant pool
class definitiondata
Javacompiler
Class2.classconstant pool
class definitiondata
ClassN.classconstant pool
class definitiondata
classes.dexheader
constant poolClass1 definitionClass2 definition
...ClassN definition
data
dx
NDK Introduction to Android, Lecture 1 10/30
![Page 11: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/11.jpg)
Libraries
I bioniC (libc)I Much smaller than glibc
I sqliteI Managing SQL databases
I OpenGL ESI Standard software interface for 3D processing hardware
I WebKitI Display web pagesI Android, Apple iOS, BlackBerry, Tizen
I SSLI Securing the communication over Internet
NDK Introduction to Android, Lecture 1 11/30
![Page 12: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/12.jpg)
Application Framework
I ServicesI Managers
I TelephonyI LocationI ActivityI PackageI Notification
I Content Providers
NDK Introduction to Android, Lecture 1 12/30
![Page 13: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/13.jpg)
Application Framework
Application process System processes
Binder Service 1
Thread
Binder Service N
Thread. . .
Application APIRPCstub
Native application libraries
JNI
NDK Introduction to Android, Lecture 1 13/30
![Page 14: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/14.jpg)
Outline
Rules and Grading
Android Architecture
Application components
IPC
Tools
Keywords
NDK Introduction to Android, Lecture 1 14/30
![Page 15: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/15.jpg)
Application components
I User interactionI Activities
I Background functionalityI ServicesI Broadcast ReceiversI Content Providers
NDK Introduction to Android, Lecture 1 15/30
![Page 16: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/16.jpg)
Activity
I User interface
I Similar to a window from window-based GUIs
I Cannot be minimized, maximized, resized
I Uses the whole visual area
I User interacts with a single activity at a timeI Activities stack
I Activities launch other activitiesI Back button for returning to the previous activityI No forward button
I Start activities with intents
NDK Introduction to Android, Lecture 1 16/30
![Page 17: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/17.jpg)
Activity Lifecycle
Source: http://developer.android.com
NDK Introduction to Android, Lecture 1 17/30
![Page 18: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/18.jpg)
Service
I Background threadI Runs in the same process as the application
I Can be configured to run in another process
I Provide services to the other applications
I Communication through the Binder
NDK Introduction to Android, Lecture 1 18/30
![Page 19: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/19.jpg)
Broadcast Receiver
I Receive broadcast announcementsI Low batteryI RebootI Application state changes
I Can receive global or local broadcastsI Choose which broadcasts to receive
I Intent filters
I Intents
I Active only when receiving a broadcast
NDK Introduction to Android, Lecture 1 19/30
![Page 20: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/20.jpg)
Content Provider
I Store and share application data
I Required for sharing data
I Relational database
I URI for identifying the provider and the table
I Content Resolver uses the URI to send a query to the provider
I Active only when responding to a request
NDK Introduction to Android, Lecture 1 20/30
![Page 21: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/21.jpg)
Outline
Rules and Grading
Android Architecture
Application components
IPC
Tools
Keywords
NDK Introduction to Android, Lecture 1 21/30
![Page 22: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/22.jpg)
Intents
I Send message, determine action executionI Purpose
I Start activities, start or bind servicesI Delivering broadcast messages to receivers
I Dispatched by the Android systemI Includes action and data
I ACTION DIAL content://contacts/people/1
I TypesI Explicit: directed towards a specific receiverI Implicit: a receiver which can resolve the action
NDK Introduction to Android, Lecture 1 22/30
![Page 23: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/23.jpg)
Binder
I Lightweight RPC
I Remote object invocation
I In process and interprocess
I Transmit parcels of data
I Synchronous calls (blocking)
NDK Introduction to Android, Lecture 1 23/30
![Page 24: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/24.jpg)
Outline
Rules and Grading
Android Architecture
Application components
IPC
Tools
Keywords
NDK Introduction to Android, Lecture 1 24/30
![Page 25: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/25.jpg)
SDK Tools
I Android SDK ManagerI Download SDK packages
I AVD ManagerI Manages Android Virtual Devices (for emulator)
I EmulatorI Virtual mobile devices running on a PC
I Dalvik Debug Monitor Server (ddms)I Debugging toolI Port forwarding, screen capture, call and SMS spoofing,
location spoofing, etc.
NDK Introduction to Android, Lecture 1 25/30
![Page 26: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/26.jpg)
SDK Tools
I Android Debug Bridge (adb)I Communication between the development tools and (virtual)
device
I dxI Generates the classes.dex file from several .class files
I Android Interface Definition Language (aidl)I To allow clients from another application to access your serviceI Generates interfaces and stubs that are used by the Binder
I Android Asset Packaging Tool (aapt)I Create, update and view Zip-compatible archives (zip, apk, jar)I Compile resources into binary assets (XML files, etc.)
I dexdumpI Disassembler toolI Obtain the Dalvik bytecode from classes.dex
NDK Introduction to Android, Lecture 1 26/30
![Page 27: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/27.jpg)
Android Debug Bridge
I Three componentsI Client: runs on the development machineI Server: background process on the development machineI Daemon: background process on the (virtual) device
I Copy files
I Install applications
I Debug
I Shell on the (virtual) device
NDK Introduction to Android, Lecture 1 27/30
![Page 28: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/28.jpg)
Emulator
I QEMU
I Screen, Keyboard, Network, Audio, GPS, RadioI Can be acceleration through virtualization
I x86 System ImageI Intel Hardware Accelerated Execution Manager (HAXM) on
WindowsI KVM on Linux
I GPU accelerated
NDK Introduction to Android, Lecture 1 28/30
![Page 29: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/29.jpg)
Outline
Rules and Grading
Android Architecture
Application components
IPC
Tools
Keywords
NDK Introduction to Android, Lecture 1 29/30
![Page 30: Introduction to Android · 2014-05-26 · Introduction to Android Lecture 1 Android Native Development Kit 9 February 2014 ... system components I Apache Harmony project ... I Android,](https://reader034.vdocuments.site/reader034/viewer/2022042319/5f08ef2a7e708231d4246eb8/html5/thumbnails/30.jpg)
Keywords
I Linux kernel
I AOSP
I Android Runtime
I Libraries
I Activities
I Services
I Broadcast Receivers
I Content Providers
I Intents
I Binders
I ADB
I Emulator
NDK Introduction to Android, Lecture 1 30/30