Building Android Applications

  • View
    1.167

  • Download
    2

Embed Size (px)

Text of Building Android Applications

  • 1. Colorado Software Summit: October 19 24, 2008 Copyright 2008, GoogleBuilding Android Applications Dan Morrill Android Development Slide 1

2. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Agenda Overview & Inspiration Application components Practical matters Dan Morrill Android DevelopmentSlide 2 3. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google A Powerful TrendWhy?Dan Morrill Android Development Slide 3 4. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google A Powerful Trend Dan Morrill Android DevelopmentSlide 4 5. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google A Powerful TrendInternet and Mobile Phone Users, Worldwide4,000,000,000 3,000,000,000 2,000,000,000 1,000,000,00002000 2001 2002 20032004 20052006 2007 Internet users (PC-based) Mobile phone users Dan Morrill Android DevelopmentSlide 5 6. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Open Handset Alliance Members Dan Morrill Android DevelopmentSlide 6 7. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Open Handset Alliance Members Mobile Operators Dan Morrill Android DevelopmentSlide 7 8. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Open Handset Alliance Members Handset ManufacturersMobile Operators Dan Morrill Android DevelopmentSlide 8 9. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Open Handset Alliance Members Handset Manufacturers Software Mobile Operators Dan Morrill Android DevelopmentSlide 9 10. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Open Handset Alliance Members Handset Manufacturers Software Mobile Operators Semiconductor Dan Morrill Android Development Slide 10 11. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Open Handset Alliance Members Handset Manufacturers Software Mobile Operators SemiconductorCommercializationDan Morrill Android Development Slide 11 12. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Linux KernelDisplayCamera DriverBluetooth Flash Memory Binder (IPC)DriverDriverDriverDriver USB Driver Keypad DriverWiFi Driver AudioPowerDriversManagement Dan Morrill Android DevelopmentSlide 12 13. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Libraries Surface Manager MediaSQLiteFrameworkOpenGL | ES FreeTypeWebKitSGL SSLlibc Linux KernelDisplayCamera DriverBluetooth Flash Memory Binder (IPC)DriverDriverDriverDriver USB Driver Keypad DriverWiFi Driver AudioPowerDriversManagement Dan Morrill Android DevelopmentSlide 13 14. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google LibrariesAndroid Runtime Surface Manager MediaSQLiteCore LibrariesFrameworkOpenGL | ES FreeTypeWebKit Dalvik VirtualMachine SGL SSLlibc Linux KernelDisplayCamera DriverBluetooth Flash Memory Binder (IPC)DriverDriverDriverDriver USB Driver Keypad DriverWiFi Driver AudioPowerDriversManagement Dan Morrill Android DevelopmentSlide 14 15. Colorado Software Summit: October 19 24, 2008 Copyright 2008, GoogleApplication Framework Activity Manager WindowContent View Notication Manager ProvidersSystem Manager Package ManagerTelephony Resource LocationGTalk ServiceManagerManagerManager LibrariesAndroid Runtime Surface Manager MediaSQLite Core LibrariesFrameworkOpenGL | ES FreeTypeWebKitDalvik Virtual Machine SGL SSLlibc Linux KernelDisplayCamera DriverBluetooth Flash MemoryBinder (IPC)DriverDriverDriver Driver USB Driver Keypad DriverWiFi Driver Audio PowerDrivers Management Dan Morrill Android DevelopmentSlide 15 16. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google ApplicationsHomeContacts Phone Browser ... Application Framework Activity Manager WindowContent View Notication Manager ProvidersSystem Manager Package ManagerTelephony Resource LocationGTalk ServiceManagerManagerManager LibrariesAndroid Runtime Surface Manager MediaSQLite Core LibrariesFrameworkOpenGL | ES FreeTypeWebKitDalvik Virtual Machine SGL SSLlibc Linux KernelDisplayCamera DriverBluetooth Flash MemoryBinder (IPC)DriverDriverDriver Driver USB Driver Keypad DriverWiFi Driver Audio PowerDrivers Management Dan Morrill Android DevelopmentSlide 16 17. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Application Building Blocks UI component typically corresponding toActivity one screen.Set and respond to notications or statusIntentReceiver changes. Can wake up your app.Service Faceless task that runs in the background.ContentProvider Enable applications to share data.Dan Morrill Android DevelopmentSlide 17 18. Emulator Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google QEMU-based ARM emulator runs same system image as a device Use same toolchain to work with devices or emulator Dan Morrill Android DevelopmentSlide 18 19. Eclipse Plugin Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Project template Dan Morrill Android Development Slide 19 20. Debugging Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Call stackExamine variables Breakpoints, single stepping Dan Morrill Android DevelopmentSlide 20 21. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Dan Morrill Android Development Slide 21 22. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Industry Dan Morrill Android Development Slide 22 23. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Software stack open- sourced under Apache 2.0 license IndustrySource available after rst handsets ship Anyone will be able to build a system image Dan Morrill Android DevelopmentSlide 23 24. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Industry Dan Morrill Android Development Slide 24 25. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google IndustryUsers Dan Morrill Android DevelopmentSlide 25 26. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Users have control of their experience IndustryThey control what gets Users installed They choose the defaultsDan Morrill Android DevelopmentSlide 26 27. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google IndustryUsers Dan Morrill Android DevelopmentSlide 27 28. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google DevelopersIndustry Users Dan Morrill Android Development Slide 28 29. Colorado Software Summit: October 19 24, 2008 Copyright 2008, GoogleDevelopersDont need permission to ship an application No hidden or privileged Industryframework APIsUsers Can integrate, extend, and replace existing components Dan Morrill Android DevelopmentSlide 29 30. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Dan Morrill Android Development Slide 30 31. Integrate Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Dan Morrill Android Development Slide 31 32. Integrate Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Dan Morrill Android Development Slide 32 33. Integrate Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Dan Morrill Android Development Slide 33 34. IntegrateExtend Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Dan Morrill Android DevelopmentSlide 34 35. IntegrateExtend Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Dan Morrill Android DevelopmentSlide 35 36. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Replace Dan Morrill Android Development Slide 36 37. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Replace Dan Morrill Android Development Slide 37 38. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Replace Dan Morrill Android Development Slide 38 39. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Replace Dan Morrill Android Development Slide 39 40. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Replace Dan Morrill Android Development Slide 40 41. Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Basics of User Interfaces Dan Morrill Android Development Slide 41 42. Creating UIs Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google 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/layoutsres/values @id/name_for_component gives you handle for referencing XML declarations in codeDan Morrill Android DevelopmentSlide 42 43. Views Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Views are building blocks Examples: Can be as basic as: TextView, EditText, or ListView Fancier views: ImageView, MapView, WebView Dan Morrill Android Development Slide 43 44. Layouts Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Controls how Views are laid out FrameLayout : each child a layer LinearLayout : single row or column RelativeLayout : relative to other Views TableLayout : rows and columns AbsoluteLayout : coordinates Dan Morrill Android Development Slide 44 45. Layouts re-sized Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google 480x320240x320 320x240Dan Morrill Android Development Slide 45 46. Layout Parameters Colorado Software Summit: October 19 24, 2008 Copyright 2008, Google Specify many aspects of whats being rendered Examples: android:layout_heightandroid:layout_width Tip: start with documentation for a specic View or Layout and then look at whats inherited from parent class Dan Morrill Android DevelopmentSlide 46 47. Colorado Software Summit: October 19 24, 2008 Copyrigh