Slides7 PDF
Slides7 PDF
to Android
Tuesday, December 4, 12
Introduction to Android
• What is Android?
• Installation
• Getting Started
• Anatomy
Application
of an Android
MMI2 2
Tuesday, December 4, 12
What is Android?
• Released in Nov. 2007 – rumored to be some kind of GPhone
• Open, free mobile platform with a complete software stack
• Operating system
• Middleware
• Key mobile applications
• Developed by the Open Handset Alliance
• Built on the open Linux kernel
• Custom Dalvik virtual machine for mobile environments
• Applications written in Java
• Open source; Apache v2 open source license
• Applications can access all core functionalities of a mobile device
• (Nearly) no differentiation between core and 3rd party applications
• Can be extended to incorporate new technologies
MMI2 3
Tuesday, December 4, 12
Open Handset Alliance
• Group of more than 30 technology and mobile
companies led by Google
• Mobile Operators, e.g. China Mobile, KDDI, NTT
DoCoMo, TMobile,
• Sprint Nextelk, Telefonica
• Semiconductor Companies, e.g. Broadcom, Intel,
Nvidia, Qualcomm, SiRF, Texas Instruments
• Handset Manufactureres, e.g. HTC, LG, Motorola,
Samsung
• Software Companies, e.g. eBay, Google,
MMI2 4
Tuesday, December 4, 12
Open Handset Alliance
• Group of more than 30 technology and mobile
companies led by Google
• Mobile Operators, e.g. China Mobile, KDDI, NTT
DoCoMo, TMobile,
• Sprint Nextelk, Telefonica
• Semiconductor Companies, e.g. Broadcom, Intel,
Nvidia, Qualcomm, SiRF, Texas Instruments
• Handset Manufactureres, e.g. HTC, LG, Motorola,
Samsung
• Software Companies, e.g. eBay, Google,
MMI2 4
Tuesday, December 4, 12
Android Features
• Application framework enabling reuse and replacement of components
• Dalvik virtual machine optimized for mobile devices (register based)
• Integrated browser based on the open source WebKit engine
• Optimized graphics powered by a custom 2D graphics library; 3D graphics
based on the OpenGL ES specification (hardware acceleration optional)
• SQLite for structured data storage
• Media support for common audio, video, and still image formats (MPEG4, H.
264, MP3, AAC, AMR, JPG, PNG, GIF)
• GSM Telephony (hardware dependent)
• Bluetooth, EDGE, 3G, WiFi, NFC (hardware dependent)
• Camera, GPS, compass, accelerometer, gyroscope (hardware dependent)
• Rich development environment including a device emulator, tools for
debugging, memory and performance profiling, and a plugin for the Eclipse IDE
Source: http://code.google.com/android/index.html
MMI2 5
Tuesday, December 4, 12
Android Architecture
Source: http://code.google.com/android/index.html
MMI2 6
Tuesday, December 4, 12
Android Architecture
Source: http://code.google.com/android/index.html
MMI2 6
Tuesday, December 4, 12
Android Architecture
Source: http://code.google.com/android/index.html
MMI2 6
Tuesday, December 4, 12
Android Architecture
Source: http://code.google.com/android/index.html
MMI2 6
Tuesday, December 4, 12
Linux Kernel
• Linux kernel version 2.6
• Abstraction layer between hardware and the
software stack
• Core services
• Memory management
Security
• Process management
• Network stack
• Driver model
•
MMI2 7
Tuesday, December 4, 12
Libraries
• C/C++ libraries used by various Android components
• Developers can use their capabilities through the
application framework
• Includes:
• WebKit/LibWebCore: web browser engine
Media Libraries: includes MPEG4, H.264, MP3, JPG, PNG,
• SQLite: relational database engine
• Libraries/engines for 2D and 3D graphics
•
MMI2 8
Tuesday, December 4, 12
Android Runtime
MMI2 9
Tuesday, December 4, 12
Applications /
MMI2 10
Tuesday, December 4, 12
Core Android Packages
• android.util
• contains various low-level utility classes, such as specialized container classes, XML utilities, etc.
• android.os
• provides basic operating system services, message passing, and inter-process communication.
• android.graphics
• is the core rendering package.
• android.text, android.text.method, android.text.style, and android.text.util
• supply a rich set of text processing tools, supporting rich text, input methods, etc.
• android.database
• contains low-level APIs for working with databases.
• android.content
• provides various services for accessing data on the device: applications installed on the device and
their associated resources, and content providers for persistent dynamic data.
• android.view
• is the core user-interface framework.
• android.widget
• supplies standard user interface elements (lists, buttons, layout managers, etc) built from the view
package.
• android.app
• provides the high-level application model, implemented using Activities.
MMI2 11
Tuesday, December 4, 12
The Tasteful Android
Version History
MMI2 12
Tuesday, December 4, 12
2008
1.0
• Many elements where
there from the start
• No widgets yet
• Notification Bar
• No tasty name yet ;)
http://www.chip.de/bildergalerie/Android-Timeline-Alle-Versionen-alle-
Einfuehrungs-Handys-Galerie_53930690.html MMI2 13
Tuesday, December 4, 12
2009
1.5 (Cupcake)
• Onscreen-Keyboard with
„Autocomplete“
• Screen switch Animations
• Videoupload
http://www.chip.de/bildergalerie/Android-Timeline-Alle-Versionen-alle-
Einfuehrungs-Handys-Galerie_53930690.html
http://images3.wikia.nocookie.net/__cb20110428020146/uncyclopedia/
images/4/4b/Cupcake.jpg
MMI2 14
Tuesday, December 4, 12
2009
1.6 (Donut)
http://www.chip.de/bildergalerie/Android-Timeline-Alle-Versionen-alle-
Einfuehrungs-Handys-Galerie_53930690.html
http://images4.wikia.nocookie.net/__cb20120101131538/smosh/images/b/
b2/Pink_frosted_sprinkled_donut.jpg
MMI2 15
Tuesday, December 4, 12
2009
2.0 (Eclair)
• Speed improvements
• More screen resolutions
(dip)
• Camera flash support
• Live wallpapers
• Multitouch support
http://www.chip.de/bildergalerie/Android-Timeline-Alle-Versionen-alle-
Einfuehrungs-Handys-Galerie_53930690.html
http://gadgetsteria.com/wp-content/uploads/2010/01/eclair.jpg MMI2 16
Tuesday, December 4, 12
2010
2.2 (FroYo)
http://www.chip.de/bildergalerie/Android-Timeline-Alle-Versionen-alle-
Einfuehrungs-Handys-Galerie_53930690.html
http://www.talkandroid.com/wp-content/uploads/2010/08/FroYo.jpg?
3995d3
MMI2 17
Tuesday, December 4, 12
2010
2.3 (Gingerbread)
• Dual-Core-Unterstützung
• NFC
• HTML5
• bessere Garbage Collection
http://www.chip.de/bildergalerie/Android-Timeline-Alle-Versionen-alle-
Einfuehrungs-Handys-Galerie_53930690.html
http://www.exclusivelyfood.com.au/uploaded_images/
gingerbread7-744309.JPG
MMI2 18
Tuesday, December 4, 12
2011
3.X (Honeycomb)
• Tablet Optimized
http://www.chip.de/bildergalerie/Android-Timeline-Alle-Versionen-alle-
Einfuehrungs-Handys-Galerie_53930690.html
http://phandroid.s3.amazonaws.com/wp-content/uploads/2010/08/honey-
comb-l.jpg
MMI2 19
Tuesday, December 4, 12
2011
4.X (Ice Cream
Sandwich)
http://www.chip.de/bildergalerie/Android-Timeline-Alle-Versionen-alle-
Einfuehrungs-Handys-Galerie_53930690.html
http://www.blogcdn.com/www.engadget.com/media/
2011/05/11x05101719.jpg
MMI2 20
Tuesday, December 4, 12
2012
4.1 (Jelly Bean)
http://www.chip.de/bildergalerie/Android-Timeline-Alle-Versionen-alle-
Einfuehrungs-Handys-Galerie_53930690.html
http://2.bp.blogspot.com/-VYTzIzPtI_o/TbD6WqeBNII/AAAAAAAABfo/
sKcKyGozpxg/s1600/jellybelly-flavor-guide.jpeg
MMI2 21
Tuesday, December 4, 12
Installing The SDK
MMI2 22
Tuesday, December 4, 12
Installing SDK
MMI2 23
Tuesday, December 4, 12
Installing SDK
MMI2 24
Tuesday, December 4, 12
The Nexus One
MMI2 25
Tuesday, December 4, 12
The Nexus One
MMI2 25
Tuesday, December 4, 12
Hello World
MMI2 26
Tuesday, December 4, 12
Hello Android I
MMI2 27
Tuesday, December 4, 12
Hello Android II
Source: http://code.google.com/android/index.html
MMI2 28
Tuesday, December 4, 12
Hello Android III
Source: http://code.google.com/android/index.html
MMI2 29
Tuesday, December 4, 12
Hello Android IV
MMI2 30
Tuesday, December 4, 12
Hello World
MMI2 31
Tuesday, December 4, 12
Anatomy of an Android Application
• 4applications
main building blocks for Android
• Activity
• Intent Receiver
• Service
• Content Provider
• AndroidManifest.xml lists all components of
an application, their capabilities and
requirements
Source: http://code.google.com/android/index.html
MMI2 32
Tuesday, December 4, 12
Activity
• Single, focused thing or task
• Extends the Activity base class
• Refers to a single screen in a (multi-screen)
application
• Displays a UI, interacts with user, responds to
events
• •2 main methods:
onCreate(Bundle): initialization of activity, set UI,
…
• onPause(): leaving an activity
• •Intent Filter
Describes what Intents an activity can handle
• Activities publish Intent Filters describing their capabilities/
how they can handle certain Intents and their actions
• Navigating between screens is accomplished by resolving
Intents => system matches Intents and Intent Filters
• Activity calls method startActivity(myIntent)
MMI2 34
Tuesday, December 4, 12
Intent Receiver, Service, Content Provider
• Intent Receiver
• phone rings
Used to execute code upon an external event, e.g.
MMI2 35
Tuesday, December 4, 12
Life Cycle of an Android Application
MMI2 36
Tuesday, December 4, 12
Android’s Importance Hierarchy
1. Foreground Process
• Required for current user activities
• E.g. running an Activity at the top of the screen
2. Visible Process
• Activity is visible but not in the foreground (onPause())
• E.g. previous activity displayed behind a foreground dialog
3. Service Process
• Holds a Service, not directly visible (e.g. media player,
network up/download)
4. Background Process
• Holds an Activity that is currently not visible (onStop())
• Can be killed at any time to reclaim memory
5. Empty Process
• Holds no active application components
MMI2 37
Tuesday, December 4, 12
Fragen?
MMI2 38
Tuesday, December 4, 12