SlideShare a Scribd company logo
Daniel Switkin
Senior Software Engineer, Google Inc.
Android Application Development
Goal
• Get you an idea of how to start developing
Android applications
• Introduce major Android application concepts
• Walk you through a sample application in the
development environment
Agenda
• System architecture
• Hello World!
• Application components
• Practical matters
• Toolchain
What is Android?
• A free, open source mobile platform
• A Linux-based, multiprocess, multithreaded OS
• Android is not a device or a product
• It’s not even limited to phones - you could build
a DVR, a handheld GPS, an MP3 player, etc.
Android Runtime
DalvikVirtual
Machine
Core Libraries
Application Framework
View
System
Content
Providers
Resource
Manager GTalk ServiceLocation
Manager
Activity Manager
Package Manager
Window
Manager
Telephony
Manager
Notification
Manager
Linux Kernel
Display
Driver Camera Driver Bluetooth
Driver
Flash Memory
Driver
Binder (IPC)
Driver
Power
ManagementUSB Driver Keypad Driver WiFi Driver Audio
Drivers
Libraries
FreeType
SGL SSL
SQLite
WebKit
libc
Surface Manager
OpenGL | ES
Media
Framework
Applications
Home PhoneContacts Browser ...
Hello World!
The History of GUIs
• Hardcoded to the screen
• Hardcoded to the window
• Hardcoded within a view hierarchy
• Dynamic layout within a view hierarchy
Generating GUIs
• Two ways to create GUIs: in XML or in code
• Declarative route via XML has advantages
• A lot of your GUI-related work will take place in:
•res/layout
•res/values
•@id/name_for_component gives you
handle for referencing XML declarations in code
Views
• Views are building blocks
• Examples:
• Can be as basic as:TextView, EditText, or
ListView
• Fancier views: ImageView, MapView,WebView
Layouts
• Controls howViews are laid out
• FrameLayout : each child a layer
• LinearLayout : single row or column
• RelativeLayout : relative to otherViews
• TableLayout : rows and columns
• AbsoluteLayout : <x,y> coordinates
Layouts are resizable
480x320
240x320
320x240
Layouts are customizable
res/layout/share.xml res/layout-land/share.xml
Layout Parameters
• Specify many aspects of what’s being rendered
• Examples:
• android:layout_height
• android:layout_width
• Tip: start with documentation for a specificView
or Layout and then look at what’s inherited from
parent class
Application Components
Basic components
Activities
UI component typically
corresponding to one screen.
BroadcastReceivers Respond to broadcast Intents.
Services
Faceless tasks that run in the
background.
ContentProviders Enable applications to share data.
Activities
• Typically correspond to one screen in a UI
• But, they can:
• be faceless
• be in a floating window
• return a value
Intents
• Think of Intents as a verb and object; a
description of what you want done
• Examples: VIEW, CALL, PLAY, etc.
• System matches Intent with Activity that can best
provide that service
• Activities and BroadcastReceivers describe what
Intents they can service in their IntentFilters (via
AndroidManifest.xml)
Intents
GMail
Contacts
Chat
Home
Picasa
Blogger
“Pick photo”
Client component makes a
request for a specific action
System picks best
component for that action
Components can be
replaced any time
New components can use
existing functionality
Photo
Gallery
BroadcastReceivers
• Components designed to respond to broadcast
Intents
• Think of them as a way to respond to external
notifications or alarms
• Applications can invent and broadcast their own
Intents as well
Services
• Faceless components that run in the background
• Example: music player, network downlaod, etc.
• Bind your code to a running service via a
remote-able interface defined in an IDL
• Can run in your own process or separate
process
ContentProviders
• Enables sharing of data across applications
• Examples: address book, photo gallery, etc.
• Provides uniform APIs for:
• querying (returns a Cursor)
• delete, update, and insert rows
• Content is represented by URI and MIME type
Practical matters
Storage and Persistence
• A couple of different options:
• Preferences
• Flat file
• SQLite
• ContentProvider
Packaging
• Think of .apk files as Android packages
• Everything needed for an application is bundled
up therein
• Basically a glorified ZIP file
Resources
• res/layout: declarative layout files
• res/drawable: intended for drawing
• res/anim: bitmaps, animations for transitions
• res/values: externalized values for things like
strings, colors, styles, etc.
• res/xml: general XML files used at runtime
• res/raw: binary files (e.g. sound)
Assets
• Similar to Resources
• Differences:
• Read-only
• InputStream access to assets
• Any kind of file
• Be mindful of file sizes
Application Lifecycle
• Application lifecycle is managed by the system
• Application start/stop is transparent to the user
• End-user only sees that they are moving between
screens
• Read documentation for android.app.Activity
Toolchain
Emulator
• QEMU-based ARM emulator
runs same system image as
a device
• Use same toolchain to work
with devices or emulator
Eclipse Plugin
Project template
Debugging
Call stack
Breakpoints, single stepping
Examine variables
Eclipse demo
Q & A

More Related Content

PPTX
Entity Framework and Domain Driven Design
PDF
Domain-Driven Design with ASP.NET MVC
PPTX
EF6 and DDD
PPTX
Implementing DDD Concepts in PHP
PDF
Refactoring for Domain Driven Design
PPTX
Linq architecture
PPTX
Programming&amp;coding
PPTX
Zeeto Tech Exchange: Design for Scalability - Front-End
Entity Framework and Domain Driven Design
Domain-Driven Design with ASP.NET MVC
EF6 and DDD
Implementing DDD Concepts in PHP
Refactoring for Domain Driven Design
Linq architecture
Programming&amp;coding
Zeeto Tech Exchange: Design for Scalability - Front-End

What's hot (15)

PDF
Context oriented architecture - Put the boundary in the right place
PDF
Demo Neo4j - Big Data Paris
POTX
Introduction to Android
PPT
Building Maps with Leaflet
PPTX
Domain Driven Design Ruby Ways - JURNAL 05/10/2017
PPSX
Introduction to C#
PPTX
SiriusCon17 - Eclipse Sirius at a glance
PPTX
Web Development Technologies
PPTX
Reversengineering
PPTX
Why do I Love C#?
PPTX
Digital Library Cloud Services
PDF
Android
PPTX
Android development course in pune ppt.
PDF
Startup Bootcamp - Intro to NoSQL/Big Data by DataZone
PPT
Introduction to ASP.NET
Context oriented architecture - Put the boundary in the right place
Demo Neo4j - Big Data Paris
Introduction to Android
Building Maps with Leaflet
Domain Driven Design Ruby Ways - JURNAL 05/10/2017
Introduction to C#
SiriusCon17 - Eclipse Sirius at a glance
Web Development Technologies
Reversengineering
Why do I Love C#?
Digital Library Cloud Services
Android
Android development course in pune ppt.
Startup Bootcamp - Intro to NoSQL/Big Data by DataZone
Introduction to ASP.NET
Ad

Viewers also liked (20)

PPT
Digital brain co_13_print_crystalgraphics.com_powerpoint_templates_trial
PPT
Open source mobile development solutions
PPT
Mobile app development sylhet it academy
PDF
DOCX
ALI SHAN CV Software-Engineer-Resume
PDF
eCertificate
PPTX
Android course (lecture2)
DOC
Naveen ResuMeS - Copy (1)
PDF
Day1 before getting_started
PPTX
Android course (lecture1)
PPT
Developing a mobile application curriculum which empowers authentic
PDF
CV IT Support-Software Engineer
PDF
Android Basic- CMC
PPTX
Android MapView and MapActivity
PPT
Artificail Intelligent lec-1
PDF
Lecture 5: Storage: Saving Data Database, Files & Preferences
PPTX
Client-Server
PDF
Mahmoud Elmasry CV - Senior Software Quality Assurance Engineer
Digital brain co_13_print_crystalgraphics.com_powerpoint_templates_trial
Open source mobile development solutions
Mobile app development sylhet it academy
ALI SHAN CV Software-Engineer-Resume
eCertificate
Android course (lecture2)
Naveen ResuMeS - Copy (1)
Day1 before getting_started
Android course (lecture1)
Developing a mobile application curriculum which empowers authentic
CV IT Support-Software Engineer
Android Basic- CMC
Android MapView and MapActivity
Artificail Intelligent lec-1
Lecture 5: Storage: Saving Data Database, Files & Preferences
Client-Server
Mahmoud Elmasry CV - Senior Software Quality Assurance Engineer
Ad

Similar to Lecture3 (20)

PDF
Android application development
PDF
Android Bootcamp
PDF
PPTX
Android apps development
PPTX
Project a day 2 android application fundamentals
PPTX
Android Development Basics
PDF
Android Jump Start
PPT
Mobile Application Development With Android
PPT
LA_FUNDAMENTALS OF Android_Unit I ONE.ppt
ODP
Nativa Android Applications development
PPTX
Introduction to Android and Android Studio
PPT
introductiontoandroiddevelopment (2).ppt
PDF
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
PPTX
Android beginners David
DOCX
Android Tutorial For Beginners Part-1
PDF
Android Development Tutorial
PPTX
Android development orientation for starters v2
PPTX
Android quick talk
PPTX
Technology and Android.pptx
PPT
Synapseindia android apps overview
Android application development
Android Bootcamp
Android apps development
Project a day 2 android application fundamentals
Android Development Basics
Android Jump Start
Mobile Application Development With Android
LA_FUNDAMENTALS OF Android_Unit I ONE.ppt
Nativa Android Applications development
Introduction to Android and Android Studio
introductiontoandroiddevelopment (2).ppt
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Android beginners David
Android Tutorial For Beginners Part-1
Android Development Tutorial
Android development orientation for starters v2
Android quick talk
Technology and Android.pptx
Synapseindia android apps overview

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Electronic commerce courselecture one. Pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
KodekX | Application Modernization Development
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
cuic standard and advanced reporting.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
NewMind AI Weekly Chronicles - August'25 Week I
Dropbox Q2 2025 Financial Results & Investor Presentation
Unlocking AI with Model Context Protocol (MCP)
Electronic commerce courselecture one. Pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
20250228 LYD VKU AI Blended-Learning.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
KodekX | Application Modernization Development
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation theory and applications.pdf
MYSQL Presentation for SQL database connectivity
Per capita expenditure prediction using model stacking based on satellite ima...
cuic standard and advanced reporting.pdf
Understanding_Digital_Forensics_Presentation.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Network Security Unit 5.pdf for BCA BBA.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
The AUB Centre for AI in Media Proposal.docx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

Lecture3

  • 1. Daniel Switkin Senior Software Engineer, Google Inc. Android Application Development
  • 2. Goal • Get you an idea of how to start developing Android applications • Introduce major Android application concepts • Walk you through a sample application in the development environment
  • 3. Agenda • System architecture • Hello World! • Application components • Practical matters • Toolchain
  • 4. What is Android? • A free, open source mobile platform • A Linux-based, multiprocess, multithreaded OS • Android is not a device or a product • It’s not even limited to phones - you could build a DVR, a handheld GPS, an MP3 player, etc.
  • 5. Android Runtime DalvikVirtual Machine Core Libraries Application Framework View System Content Providers Resource Manager GTalk ServiceLocation Manager Activity Manager Package Manager Window Manager Telephony Manager Notification Manager Linux Kernel Display Driver Camera Driver Bluetooth Driver Flash Memory Driver Binder (IPC) Driver Power ManagementUSB Driver Keypad Driver WiFi Driver Audio Drivers Libraries FreeType SGL SSL SQLite WebKit libc Surface Manager OpenGL | ES Media Framework Applications Home PhoneContacts Browser ...
  • 7. The History of GUIs • Hardcoded to the screen • Hardcoded to the window • Hardcoded within a view hierarchy • Dynamic layout within a view hierarchy
  • 8. Generating GUIs • Two ways to create GUIs: in XML or in code • Declarative route via XML has advantages • A lot of your GUI-related work will take place in: •res/layout •res/values •@id/name_for_component gives you handle for referencing XML declarations in code
  • 9. Views • Views are building blocks • Examples: • Can be as basic as:TextView, EditText, or ListView • Fancier views: ImageView, MapView,WebView
  • 10. Layouts • Controls howViews are laid out • FrameLayout : each child a layer • LinearLayout : single row or column • RelativeLayout : relative to otherViews • TableLayout : rows and columns • AbsoluteLayout : <x,y> coordinates
  • 13. Layout Parameters • Specify many aspects of what’s being rendered • Examples: • android:layout_height • android:layout_width • Tip: start with documentation for a specificView or Layout and then look at what’s inherited from parent class
  • 15. Basic components Activities UI component typically corresponding to one screen. BroadcastReceivers Respond to broadcast Intents. Services Faceless tasks that run in the background. ContentProviders Enable applications to share data.
  • 16. Activities • Typically correspond to one screen in a UI • But, they can: • be faceless • be in a floating window • return a value
  • 17. Intents • Think of Intents as a verb and object; a description of what you want done • Examples: VIEW, CALL, PLAY, etc. • System matches Intent with Activity that can best provide that service • Activities and BroadcastReceivers describe what Intents they can service in their IntentFilters (via AndroidManifest.xml)
  • 18. Intents GMail Contacts Chat Home Picasa Blogger “Pick photo” Client component makes a request for a specific action System picks best component for that action Components can be replaced any time New components can use existing functionality Photo Gallery
  • 19. BroadcastReceivers • Components designed to respond to broadcast Intents • Think of them as a way to respond to external notifications or alarms • Applications can invent and broadcast their own Intents as well
  • 20. Services • Faceless components that run in the background • Example: music player, network downlaod, etc. • Bind your code to a running service via a remote-able interface defined in an IDL • Can run in your own process or separate process
  • 21. ContentProviders • Enables sharing of data across applications • Examples: address book, photo gallery, etc. • Provides uniform APIs for: • querying (returns a Cursor) • delete, update, and insert rows • Content is represented by URI and MIME type
  • 23. Storage and Persistence • A couple of different options: • Preferences • Flat file • SQLite • ContentProvider
  • 24. Packaging • Think of .apk files as Android packages • Everything needed for an application is bundled up therein • Basically a glorified ZIP file
  • 25. Resources • res/layout: declarative layout files • res/drawable: intended for drawing • res/anim: bitmaps, animations for transitions • res/values: externalized values for things like strings, colors, styles, etc. • res/xml: general XML files used at runtime • res/raw: binary files (e.g. sound)
  • 26. Assets • Similar to Resources • Differences: • Read-only • InputStream access to assets • Any kind of file • Be mindful of file sizes
  • 27. Application Lifecycle • Application lifecycle is managed by the system • Application start/stop is transparent to the user • End-user only sees that they are moving between screens • Read documentation for android.app.Activity
  • 29. Emulator • QEMU-based ARM emulator runs same system image as a device • Use same toolchain to work with devices or emulator
  • 31. Debugging Call stack Breakpoints, single stepping Examine variables
  • 33. Q & A