SlideShare a Scribd company logo
INTRODUCTION TO
ANDROID
STEFAN BLOS
AGENDA
▸ Facts about Android
▸ Basic Building Blocks of Apps
▸ HelloAndroid-App
WHO IS THAT GUY?
▸ CS student with focus on Machine Learning & AI
▸ Freelance app developer
▸ Recipient of Google scholarship to learn Android at Udacity
FACTS
ABOUT
ANDROID
How many active Android devices?
2 billion
Market Share in Mobile OS
87.7 %
Number of Apps in Google Play
> 2 million
Android Introduction Talk
LARGE COMMUNITY
▸ Developers
▸ Open-Source projects
▸ Libraries
ANDROID SYSTEM
ANDROID SYSTEM
▸ Linux kernel
▸ Applications are abstracted from that - no need to worry about
lower layers
▸ Apps use Gradle as a build system
▸ Java & Kotlin as official languages for developing Apps
Android Introduction Talk
BASIC
BUILDING
BLOCKS
BUILDING BLOCKS
▸ Activities
▸ Services
▸ BroadcastReceivers
▸ ContentProviders
ACTIVITIES
▸ An Activity is the screen that the user sees
▸ Basis of user interaction
▸ They have a „lifecycle“
▸ Fragments are tiny Activities with own purpose
SERVICES
▸ Some tasks require to run in background
▸ AsyncTask is able to run when app is active
▸ Services can run even when the App is not opened
WHEN TO USE A SERVICE?
▸ Rule of thumb to distinguish between AsyncTask and
Services:
▸ AsyncTask —> quick (< 1 second), inside the app

(e.g. download user avatar, update UI from background)
▸ Service —> longer (> 1 second), also when app closes

(e.g. download mp3 in background)
BROADCAST RECEIVERS
▸ Broadcast = message sent when „events of interest“ occur
▸ Can be inside of your app or between Apps
▸ Can also be sent by the system (e.g. incoming phone call)
▸ You can either publish or subscribe to Broadcasts
CONTENT PROVIDER
▸ Best practice to store data
▸ Makes it possible to share data between apps
▸ provides an interface to easily manage different kinds of
data

(SQLite databases, video, audio, etc.)
ACTIVITIES
Android Introduction Talk
WHAT DOES IT DO?
▸ What the user sees and interacts with
▸ Shows information to your user
▸ Responds to input from your user
WHAT ARE ACTIVITIES MADE OFF?
▸ Java (or Kotlin) file for the logic and interaction
▸ Interface (.xml) file for defining what the user sees
WHAT ARE ACTIVITIES MADE OFF?
▸ Java (or Kotlin) file for the logic and interaction
▸ Interface (.xml) file for defining what the user sees
JAVA PART OF ACTIVITY
▸ Indicates which user interface is used
▸ Manages user input
▸ Responds to the activity lifecycle
ACTIVITY
LIFECYCLE
Android Introduction Talk
LIFECYCLE LITE
▸ System tells you the state of your activity
▸ When app is started —> Activity created

onCreate()
▸ When it is shown on screen —> Activity started

onStart()
LIFECYCLE LITE (CONT’D)
▸ When no longer in foreground —> Activity paused (and
resumed)

onPause() —> onResume()
▸ When no longer visible —> Activity stopped (and restarted)

onStop() —> onRestart()
▸ When it is shut down —> Activity destroyed

onDestroy()
WHAT ARE ACTIVITIES MADE OFF?
▸ Java (or Kotlin) file for the logic and interaction
▸ Interface (.xml) file for defining what the user sees
INTERFACE PART OF ACTIVITY
▸ Layout file format is .xml
▸ offers a visual editor
▸ creates the layout of the screen with building blocks
▸ showing text —> TextView
▸ show image —> ImageView
▸ let the user input text —> EditText
▸ ordering of blocks is done via layouts
TextView
ImageView
EditText
HOW TO BUILD AN INTERFACE?
▸ All building blocks are Views
▸ Views have properties like:
▸ id
▸ width
▸ height
Android Introduction Talk
Android Introduction Talk
Android Introduction Talk
HOW TO MANAGE ALL THOSE VIEWS?
▸ Views are bundled together in ViewGroups

(fun fact: these are groups of views)
▸ Layout types define the order of elements in ViewGroups
COMMON LAYOUTS
▸ LinearLayout
▸ RelativeLayout
▸ ConstraintLayout
COMMON LAYOUTS (CONT’D)
▸ Different kinds of List layouts
▸ RecyclerViews (not a real layout but important)
▸ ListView
▸ GridView
HOW CAN WE START OTHER ACTIVITIES?
▸ Intents are used (can be thought of like envelopes)
▸ On creation of intent specify Activity (here „ActivityB“) to
start and then start it:
WE CAN ALSO PASS DATA WITH INTENTS
▸ Data is put into Intent with an id by Activity A:
▸ Can be accessed with id by Activity B:
Activity A
Activity B
Data
id
id
HELLO
ANDROID
APP
WHAT TOOLS ARE WE USING?
▸ We use the Android SDK
▸ We use Android Studio
▸ Generates .apk (Android Package) which can be installed on
device
Live-Coding
SOME
USEFUL
RESSOURCES
▸ Android Developer Portal:



https://developer.android.com/
▸ Android Trainings in the Developer Portal:



https://developer.android.com/training/basics/firstapp/
index.html
▸ Slides for Beginners (also from Google):



https://drive.google.com/drive/u/0/folders/
0B5Kg0X0yIQ1Pbk5yVGdsSFFjR28
▸ Free courses on Udacity:



https://de.udacity.com/courses/android
Thanks!
On to the Codelabs…

More Related Content

PDF
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
PPTX
Learning Android Part 2/6
PPT
Create another activity and start it by intent
PPT
introductiontoandroiddevelopment (2).ppt
PPTX
Project a day 2 android application fundamentals
PPTX
Android beginners David
PPTX
Android 101
PPTX
Workshop Android for Java Developers
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
Learning Android Part 2/6
Create another activity and start it by intent
introductiontoandroiddevelopment (2).ppt
Project a day 2 android application fundamentals
Android beginners David
Android 101
Workshop Android for Java Developers

Similar to Android Introduction Talk (20)

PDF
Android session 2
PPTX
GDG School Android Workshop
PPTX
Android apps development
PDF
Workshop 04 android-development
PPTX
Introduction to Android and Android Studio
PPTX
Android app development
PPTX
Basics 4
PPTX
Android apps development
PDF
Android development first steps
PPTX
App Fundamentals and Activity life cycle.pptx
PDF
Introduction to Android Development
PPT
Android app development
PPTX
Android app fundamentals
PDF
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
PPT
LA_FUNDAMENTALS OF Android_Unit I ONE.ppt
PDF
Android Development Tutorial
PDF
Lecture3
PPTX
PPTX
Android Development Basics
PPTX
Android 101 Session @thejunction32
Android session 2
GDG School Android Workshop
Android apps development
Workshop 04 android-development
Introduction to Android and Android Studio
Android app development
Basics 4
Android apps development
Android development first steps
App Fundamentals and Activity life cycle.pptx
Introduction to Android Development
Android app development
Android app fundamentals
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
LA_FUNDAMENTALS OF Android_Unit I ONE.ppt
Android Development Tutorial
Lecture3
Android Development Basics
Android 101 Session @thejunction32
Ad

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
KodekX | Application Modernization Development
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Programs and apps: productivity, graphics, security and other tools
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Electronic commerce courselecture one. Pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
Approach and Philosophy of On baking technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
The Rise and Fall of 3GPP – Time for a Sabbatical?
Advanced methodologies resolving dimensionality complications for autism neur...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KodekX | Application Modernization Development
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Programs and apps: productivity, graphics, security and other tools
“AI and Expert System Decision Support & Business Intelligence Systems”
MYSQL Presentation for SQL database connectivity
20250228 LYD VKU AI Blended-Learning.pptx
Spectral efficient network and resource selection model in 5G networks
MIND Revenue Release Quarter 2 2025 Press Release
Mobile App Security Testing_ A Comprehensive Guide.pdf
Electronic commerce courselecture one. Pdf
sap open course for s4hana steps from ECC to s4
Network Security Unit 5.pdf for BCA BBA.
Dropbox Q2 2025 Financial Results & Investor Presentation
Per capita expenditure prediction using model stacking based on satellite ima...
Ad

Android Introduction Talk

  • 2. AGENDA ▸ Facts about Android ▸ Basic Building Blocks of Apps ▸ HelloAndroid-App
  • 3. WHO IS THAT GUY? ▸ CS student with focus on Machine Learning & AI ▸ Freelance app developer ▸ Recipient of Google scholarship to learn Android at Udacity
  • 5. How many active Android devices? 2 billion
  • 6. Market Share in Mobile OS 87.7 %
  • 7. Number of Apps in Google Play > 2 million
  • 9. LARGE COMMUNITY ▸ Developers ▸ Open-Source projects ▸ Libraries
  • 11. ANDROID SYSTEM ▸ Linux kernel ▸ Applications are abstracted from that - no need to worry about lower layers ▸ Apps use Gradle as a build system ▸ Java & Kotlin as official languages for developing Apps
  • 14. BUILDING BLOCKS ▸ Activities ▸ Services ▸ BroadcastReceivers ▸ ContentProviders
  • 15. ACTIVITIES ▸ An Activity is the screen that the user sees ▸ Basis of user interaction ▸ They have a „lifecycle“ ▸ Fragments are tiny Activities with own purpose
  • 16. SERVICES ▸ Some tasks require to run in background ▸ AsyncTask is able to run when app is active ▸ Services can run even when the App is not opened
  • 17. WHEN TO USE A SERVICE? ▸ Rule of thumb to distinguish between AsyncTask and Services: ▸ AsyncTask —> quick (< 1 second), inside the app
 (e.g. download user avatar, update UI from background) ▸ Service —> longer (> 1 second), also when app closes
 (e.g. download mp3 in background)
  • 18. BROADCAST RECEIVERS ▸ Broadcast = message sent when „events of interest“ occur ▸ Can be inside of your app or between Apps ▸ Can also be sent by the system (e.g. incoming phone call) ▸ You can either publish or subscribe to Broadcasts
  • 19. CONTENT PROVIDER ▸ Best practice to store data ▸ Makes it possible to share data between apps ▸ provides an interface to easily manage different kinds of data
 (SQLite databases, video, audio, etc.)
  • 22. WHAT DOES IT DO? ▸ What the user sees and interacts with ▸ Shows information to your user ▸ Responds to input from your user
  • 23. WHAT ARE ACTIVITIES MADE OFF? ▸ Java (or Kotlin) file for the logic and interaction ▸ Interface (.xml) file for defining what the user sees
  • 24. WHAT ARE ACTIVITIES MADE OFF? ▸ Java (or Kotlin) file for the logic and interaction ▸ Interface (.xml) file for defining what the user sees
  • 25. JAVA PART OF ACTIVITY ▸ Indicates which user interface is used ▸ Manages user input ▸ Responds to the activity lifecycle
  • 28. LIFECYCLE LITE ▸ System tells you the state of your activity ▸ When app is started —> Activity created
 onCreate() ▸ When it is shown on screen —> Activity started
 onStart()
  • 29. LIFECYCLE LITE (CONT’D) ▸ When no longer in foreground —> Activity paused (and resumed)
 onPause() —> onResume() ▸ When no longer visible —> Activity stopped (and restarted)
 onStop() —> onRestart() ▸ When it is shut down —> Activity destroyed
 onDestroy()
  • 30. WHAT ARE ACTIVITIES MADE OFF? ▸ Java (or Kotlin) file for the logic and interaction ▸ Interface (.xml) file for defining what the user sees
  • 31. INTERFACE PART OF ACTIVITY ▸ Layout file format is .xml ▸ offers a visual editor ▸ creates the layout of the screen with building blocks ▸ showing text —> TextView ▸ show image —> ImageView ▸ let the user input text —> EditText ▸ ordering of blocks is done via layouts
  • 33. HOW TO BUILD AN INTERFACE? ▸ All building blocks are Views ▸ Views have properties like: ▸ id ▸ width ▸ height
  • 37. HOW TO MANAGE ALL THOSE VIEWS? ▸ Views are bundled together in ViewGroups
 (fun fact: these are groups of views) ▸ Layout types define the order of elements in ViewGroups
  • 38. COMMON LAYOUTS ▸ LinearLayout ▸ RelativeLayout ▸ ConstraintLayout
  • 39. COMMON LAYOUTS (CONT’D) ▸ Different kinds of List layouts ▸ RecyclerViews (not a real layout but important) ▸ ListView ▸ GridView
  • 40. HOW CAN WE START OTHER ACTIVITIES? ▸ Intents are used (can be thought of like envelopes) ▸ On creation of intent specify Activity (here „ActivityB“) to start and then start it:
  • 41. WE CAN ALSO PASS DATA WITH INTENTS ▸ Data is put into Intent with an id by Activity A: ▸ Can be accessed with id by Activity B:
  • 44. WHAT TOOLS ARE WE USING? ▸ We use the Android SDK ▸ We use Android Studio ▸ Generates .apk (Android Package) which can be installed on device
  • 47. ▸ Android Developer Portal:
 
 https://developer.android.com/ ▸ Android Trainings in the Developer Portal:
 
 https://developer.android.com/training/basics/firstapp/ index.html
  • 48. ▸ Slides for Beginners (also from Google):
 
 https://drive.google.com/drive/u/0/folders/ 0B5Kg0X0yIQ1Pbk5yVGdsSFFjR28 ▸ Free courses on Udacity:
 
 https://de.udacity.com/courses/android
  • 49. Thanks! On to the Codelabs…