SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
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

Más contenido relacionado

Similar a 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
 

Similar a 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
 

Más 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
 

Más 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
 

Último

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

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