SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
Android Development
      - the basics


    Tomáš Kypta
      @TomasKypta
Outline
●   Android platform
●   Android ecosystem
●   Android SDK and development tools
●   Hello World
●   Building blocks & the manifest file
●   Activities, widgets, intents
●   Dialog, toast
Android platform
●   Linux-based operating system
●   open-source
●   originally phone OS
●   tablet (since Honeycomb)
●   Google TV
●   hundreds of devices
History
●   2003, Android inc.
●   2005 acquired by Google
●   2008 first Android phone – T-Mobile G1

●   since then rapid development of the platform
Android ecosystem
●   the world's most popular mobile platform
●   over 850 000 new devices activated each day
●   total number of devices ~ 300 million

●   play.google.com (market.android.com)
●   more than 450 000 applications
●   ~ 70% free apps
Problems
●   fragmentation
●   manufacturer/carrier enhancements
●   updates & support
●   openness – low quality apps
●   malware (users)
Sources
●   developer.android.com
●   android-developers.blogspot.com
●   source.android.com
●   stackoverflow.com
●   youtube.com/androiddevelopers
●   svetandroida.cz
Development
●   programming in “Java”
●   native apps possible (C++)

●   development tools platform friendly
●   Windows, Linux, Mac OS X
●   IDE support – ADT plugin for Eclipse,
    Netbeans, IntelliJ IDEA, ...
Android SDK
●   android – Android SDK and AVD Manager
●   adb – Android Debug Bridge
●   ddms – Dalvik Debug Monitor
●   emulator
●   hierarchyviewer
●   ProGuard
●   Traceview
●   docs
Libraries
●   compatibility libraries
●   licensing library

●   AdMob
●   Google Analytics, Flurry
●   C2DM
Android internals
Hello World
Android Building Blocks
●   Activity
●   Service
●   Content provider
●   Broadcast receiver

●   AndroidManifest.xml
Activity
●   screen with user interface
●   the only visual component

●   examples:
        –   list of emails
        –   email detail
        –   email composition
Service
●   runs in background
●   long-running tasks

●   examples:
       –   music playback service
       –   download service
       –   sync service
Content Provider
●   manages and shares application data
●   data storage doesn't matter – database, web,
    filesystem
●   apps can query and modify data through
    content provider
●   read/write permissions can be defined
●   examples:
       –   all system databases
       –   contacts
       –   SMS
Broadcast Receiver
●   responds to broadcasts
●   broadcasts are system wide
●   can be registered statically or dynamically
●   system or custom messages
●   examples:
        –   incoming SMS, incoming call
        –   screen turned off
        –   low baterry
        –   removed SD card
AndroidManifest.xml
●   defines what parts the app have
●   defines which endpoints are exposed
●   minimum API level
●   permissions
●   declare hardware and software features
●   required configuration
Intent
●   asynchronous message
●   binds components together (all of them
    except ContentProvider)
●   starting activities
●   starting services and binding to services
●   sending broadcasts
User Interface
●   defined by hierarchy of views
●   layouts = containers
       –   LinearLayout
       –   RelativeLayout
       –   FrameLayout
●   widgets = UI objects
       –   Button, TextView, EditText
       –   WebView
Activity Lifecycle
●   activities managed in a stack
●   activity can be in different states during it's
    lifecycle:
        –   foreground
        –   visible
        –   stopped
        –   killed
Intent & Activity
●   starting activity explicitly

●   starting activity implicitly



●   starting activity for result
List Widgets
●   displays a list of items (some view)
        –   ListView, Spinner, GridView, Gallery
●   use adapter to bind list to data
Dialogs and Toasts
●   Dialog – displays modal information
       –   standard dialogs
       –   custom dialogs
●   Toast – non-modal information
       –   doesn't have user focus
THE END

Contenu connexe

Similaire à Android development - the basics, FI MUNI, 2012

Android Jump Start
Android Jump StartAndroid Jump Start
Android Jump StartConFoo
 
Begining Android Development
Begining Android DevelopmentBegining Android Development
Begining Android DevelopmentHayi Nukman
 
Android Development...The 20,000-Foot View
Android Development...The 20,000-Foot ViewAndroid Development...The 20,000-Foot View
Android Development...The 20,000-Foot ViewCommonsWare
 
Programming for non tech entrepreneurs
Programming for non tech entrepreneursProgramming for non tech entrepreneurs
Programming for non tech entrepreneursRodrigo Gil
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleDmytro Semenov
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentCan Elmas
 
Introduction to Android Development and Security
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and SecurityKelwin Yang
 
Introduction to Android (before 2015)
Introduction to Android (before 2015)Introduction to Android (before 2015)
Introduction to Android (before 2015)Chien-Ming Chou
 
Day1 before getting_started
Day1 before getting_startedDay1 before getting_started
Day1 before getting_startedAhsanul Karim
 
Android App Development - 01 Introduction
Android App Development - 01 IntroductionAndroid App Development - 01 Introduction
Android App Development - 01 IntroductionDiego Grancini
 
Android Lollipop: The developer's perspective
Android Lollipop: The developer's perspectiveAndroid Lollipop: The developer's perspective
Android Lollipop: The developer's perspectiveSebastian Vieira
 
Android workshop material
Android workshop materialAndroid workshop material
Android workshop materialReza Yogaswara
 
Android Development in a Nutshell
Android Development in a NutshellAndroid Development in a Nutshell
Android Development in a NutshellAleix Solé
 
Bazillion New Technologies
Bazillion New TechnologiesBazillion New Technologies
Bazillion New TechnologiesAyman Mahfouz
 

Similaire à Android development - the basics, FI MUNI, 2012 (20)

Android Jump Start
Android Jump StartAndroid Jump Start
Android Jump Start
 
Android development
Android developmentAndroid development
Android development
 
Begining Android Development
Begining Android DevelopmentBegining Android Development
Begining Android Development
 
Android Development...The 20,000-Foot View
Android Development...The 20,000-Foot ViewAndroid Development...The 20,000-Foot View
Android Development...The 20,000-Foot View
 
Programming for non tech entrepreneurs
Programming for non tech entrepreneursProgramming for non tech entrepreneurs
Programming for non tech entrepreneurs
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Introduction to Android Development and Security
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and Security
 
Android quick talk
Android quick talkAndroid quick talk
Android quick talk
 
Introduction to Android (before 2015)
Introduction to Android (before 2015)Introduction to Android (before 2015)
Introduction to Android (before 2015)
 
Synapseindia android apps overview
Synapseindia android apps overviewSynapseindia android apps overview
Synapseindia android apps overview
 
Day1 before getting_started
Day1 before getting_startedDay1 before getting_started
Day1 before getting_started
 
Android App Development - 01 Introduction
Android App Development - 01 IntroductionAndroid App Development - 01 Introduction
Android App Development - 01 Introduction
 
Android Lollipop: The developer's perspective
Android Lollipop: The developer's perspectiveAndroid Lollipop: The developer's perspective
Android Lollipop: The developer's perspective
 
Android workshop material
Android workshop materialAndroid workshop material
Android workshop material
 
Android Development in a Nutshell
Android Development in a NutshellAndroid Development in a Nutshell
Android Development in a Nutshell
 
Codebits Talk
Codebits TalkCodebits Talk
Codebits Talk
 
Android : Deep dive into developing MobileApp using Android
Android : Deep dive into developing MobileApp using AndroidAndroid : Deep dive into developing MobileApp using Android
Android : Deep dive into developing MobileApp using Android
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
Bazillion New Technologies
Bazillion New TechnologiesBazillion New Technologies
Bazillion New Technologies
 

Plus de Tomáš Kypta

Modern Android app library stack
Modern Android app library stackModern Android app library stack
Modern Android app library stackTomáš Kypta
 
Guide to the jungle of testing frameworks
Guide to the jungle of testing frameworksGuide to the jungle of testing frameworks
Guide to the jungle of testing frameworksTomáš Kypta
 
Guide to the jungle of testing frameworks
Guide to the jungle of testing frameworksGuide to the jungle of testing frameworks
Guide to the jungle of testing frameworksTomáš Kypta
 
Practical RxJava for Android
Practical RxJava for AndroidPractical RxJava for Android
Practical RxJava for AndroidTomáš Kypta
 
Practical RxJava for Android
Practical RxJava for AndroidPractical RxJava for Android
Practical RxJava for AndroidTomáš Kypta
 
Reactive programming on Android
Reactive programming on AndroidReactive programming on Android
Reactive programming on AndroidTomáš Kypta
 
Android Develpment vol. 3, MFF UK, 2015
Android Develpment vol. 3, MFF UK, 2015Android Develpment vol. 3, MFF UK, 2015
Android Develpment vol. 3, MFF UK, 2015Tomáš Kypta
 
Writing testable Android apps
Writing testable Android appsWriting testable Android apps
Writing testable Android appsTomáš Kypta
 
Android Develpment vol. 2, MFF UK, 2015
Android Develpment vol. 2, MFF UK, 2015Android Develpment vol. 2, MFF UK, 2015
Android Develpment vol. 2, MFF UK, 2015Tomáš Kypta
 
Unit testing and Android
Unit testing and AndroidUnit testing and Android
Unit testing and AndroidTomáš Kypta
 
Android Development for Phone and Tablet
Android Development for Phone and TabletAndroid Development for Phone and Tablet
Android Development for Phone and TabletTomáš Kypta
 
Reactive programming on Android
Reactive programming on AndroidReactive programming on Android
Reactive programming on AndroidTomáš Kypta
 
Android Development 201
Android Development 201Android Development 201
Android Development 201Tomáš Kypta
 
Užitečné Android knihovny pro vývoj a testování
Užitečné Android knihovny pro vývoj a testováníUžitečné Android knihovny pro vývoj a testování
Užitečné Android knihovny pro vývoj a testováníTomáš Kypta
 
Programování pro Android - úvod, FI MUNI, 2013
Programování pro Android - úvod, FI MUNI, 2013Programování pro Android - úvod, FI MUNI, 2013
Programování pro Android - úvod, FI MUNI, 2013Tomáš Kypta
 
Stylování ActionBaru
Stylování ActionBaruStylování ActionBaru
Stylování ActionBaruTomáš Kypta
 

Plus de Tomáš Kypta (18)

Modern Android app library stack
Modern Android app library stackModern Android app library stack
Modern Android app library stack
 
Guide to the jungle of testing frameworks
Guide to the jungle of testing frameworksGuide to the jungle of testing frameworks
Guide to the jungle of testing frameworks
 
Guide to the jungle of testing frameworks
Guide to the jungle of testing frameworksGuide to the jungle of testing frameworks
Guide to the jungle of testing frameworks
 
Practical RxJava for Android
Practical RxJava for AndroidPractical RxJava for Android
Practical RxJava for Android
 
Practical RxJava for Android
Practical RxJava for AndroidPractical RxJava for Android
Practical RxJava for Android
 
Reactive programming on Android
Reactive programming on AndroidReactive programming on Android
Reactive programming on Android
 
Android Develpment vol. 3, MFF UK, 2015
Android Develpment vol. 3, MFF UK, 2015Android Develpment vol. 3, MFF UK, 2015
Android Develpment vol. 3, MFF UK, 2015
 
Writing testable Android apps
Writing testable Android appsWriting testable Android apps
Writing testable Android apps
 
Android Develpment vol. 2, MFF UK, 2015
Android Develpment vol. 2, MFF UK, 2015Android Develpment vol. 2, MFF UK, 2015
Android Develpment vol. 2, MFF UK, 2015
 
ProGuard
ProGuardProGuard
ProGuard
 
Unit testing and Android
Unit testing and AndroidUnit testing and Android
Unit testing and Android
 
Android Development for Phone and Tablet
Android Development for Phone and TabletAndroid Development for Phone and Tablet
Android Development for Phone and Tablet
 
Reactive programming on Android
Reactive programming on AndroidReactive programming on Android
Reactive programming on Android
 
Android Libraries
Android LibrariesAndroid Libraries
Android Libraries
 
Android Development 201
Android Development 201Android Development 201
Android Development 201
 
Užitečné Android knihovny pro vývoj a testování
Užitečné Android knihovny pro vývoj a testováníUžitečné Android knihovny pro vývoj a testování
Užitečné Android knihovny pro vývoj a testování
 
Programování pro Android - úvod, FI MUNI, 2013
Programování pro Android - úvod, FI MUNI, 2013Programování pro Android - úvod, FI MUNI, 2013
Programování pro Android - úvod, FI MUNI, 2013
 
Stylování ActionBaru
Stylování ActionBaruStylování ActionBaru
Stylování ActionBaru
 

Dernier

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Dernier (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Android development - the basics, FI MUNI, 2012

  • 1. Android Development - the basics Tomáš Kypta @TomasKypta
  • 2.
  • 3.
  • 4. Outline ● Android platform ● Android ecosystem ● Android SDK and development tools ● Hello World ● Building blocks & the manifest file ● Activities, widgets, intents ● Dialog, toast
  • 5. Android platform ● Linux-based operating system ● open-source ● originally phone OS ● tablet (since Honeycomb) ● Google TV ● hundreds of devices
  • 6.
  • 7. History ● 2003, Android inc. ● 2005 acquired by Google ● 2008 first Android phone – T-Mobile G1 ● since then rapid development of the platform
  • 8. Android ecosystem ● the world's most popular mobile platform ● over 850 000 new devices activated each day ● total number of devices ~ 300 million ● play.google.com (market.android.com) ● more than 450 000 applications ● ~ 70% free apps
  • 9. Problems ● fragmentation ● manufacturer/carrier enhancements ● updates & support ● openness – low quality apps ● malware (users)
  • 10. Sources ● developer.android.com ● android-developers.blogspot.com ● source.android.com ● stackoverflow.com ● youtube.com/androiddevelopers ● svetandroida.cz
  • 11. Development ● programming in “Java” ● native apps possible (C++) ● development tools platform friendly ● Windows, Linux, Mac OS X ● IDE support – ADT plugin for Eclipse, Netbeans, IntelliJ IDEA, ...
  • 12. Android SDK ● android – Android SDK and AVD Manager ● adb – Android Debug Bridge ● ddms – Dalvik Debug Monitor ● emulator ● hierarchyviewer ● ProGuard ● Traceview ● docs
  • 13. Libraries ● compatibility libraries ● licensing library ● AdMob ● Google Analytics, Flurry ● C2DM
  • 16. Android Building Blocks ● Activity ● Service ● Content provider ● Broadcast receiver ● AndroidManifest.xml
  • 17. Activity ● screen with user interface ● the only visual component ● examples: – list of emails – email detail – email composition
  • 18. Service ● runs in background ● long-running tasks ● examples: – music playback service – download service – sync service
  • 19. Content Provider ● manages and shares application data ● data storage doesn't matter – database, web, filesystem ● apps can query and modify data through content provider ● read/write permissions can be defined ● examples: – all system databases – contacts – SMS
  • 20. Broadcast Receiver ● responds to broadcasts ● broadcasts are system wide ● can be registered statically or dynamically ● system or custom messages ● examples: – incoming SMS, incoming call – screen turned off – low baterry – removed SD card
  • 21. AndroidManifest.xml ● defines what parts the app have ● defines which endpoints are exposed ● minimum API level ● permissions ● declare hardware and software features ● required configuration
  • 22. Intent ● asynchronous message ● binds components together (all of them except ContentProvider) ● starting activities ● starting services and binding to services ● sending broadcasts
  • 23. User Interface ● defined by hierarchy of views ● layouts = containers – LinearLayout – RelativeLayout – FrameLayout ● widgets = UI objects – Button, TextView, EditText – WebView
  • 24. Activity Lifecycle ● activities managed in a stack ● activity can be in different states during it's lifecycle: – foreground – visible – stopped – killed
  • 25.
  • 26. Intent & Activity ● starting activity explicitly ● starting activity implicitly ● starting activity for result
  • 27. List Widgets ● displays a list of items (some view) – ListView, Spinner, GridView, Gallery ● use adapter to bind list to data
  • 28. Dialogs and Toasts ● Dialog – displays modal information – standard dialogs – custom dialogs ● Toast – non-modal information – doesn't have user focus