Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android application development: a crash course

Ad94879495e21b7362d0d2c845f44bc0?s=47 Soham Mondal
November 03, 2012

Android application development: a crash course

An Android basics session at Droidcon 2012

Ad94879495e21b7362d0d2c845f44bc0?s=128

Soham Mondal

November 03, 2012
Tweet

Transcript

  1. ANDROID APP DEV CRASH COURSE SOHAM MONDAL Soham  Mondal  

  2. Soham  Mondal   WWW .BLRDROID.ORG

  3. WHY ANDROID? SOME GLOBAL NUMBERS Soham  Mondal  

  4. 500,000,000 ANDROID  DEVICES  GLOBALLY   h8p://ar=cles.=mesofindia.india=mes.com/2012-­‐06-­‐28/telecom/32456734_1_android-­‐devices-­‐hugo-­‐barra-­‐smartphone-­‐market   Soham  Mondal  

  5. 1,000,000+   ANDROID  HANDSET  ACTIVATIONS  PER  DAY   h8p://ar=cles.=mesofindia.india=mes.com/2012-­‐06-­‐28/telecom/32456734_1_android-­‐devices-­‐hugo-­‐barra-­‐smartphone-­‐market  

    Soham  Mondal  
  6. Soham  Mondal   ANDROID ON GOOGLE TV The  same  android

     codebase  can  run  on  android  phones,   android  tablets  and  now  even  on  televisions  running   Google  TV  
  7. SOME MORE HIGHLIGHTS New Cameras from Nikon and Sasmung expected

    to run Android, to make “intelligent” devices Android have been deployed on intelligent kiosks, cars and even household electronics devices Asus Nexus 7 tablet launched at $199 running Android 4.1 More Nexus devices expected from multiple manufacturers in October Soham  Mondal  
  8. ANDROID APP BUILDING BLOCKS Soham  Mondal  

  9. ANDROID BUILDING BLOCKS Ac=vi=es   Android  manifest.xml   Intents  

    Views   Content  providers   Services   No=fica=ons   Soham  Mondal  
  10. ANDROID BUILDING BLOCKS Android  manifest.xml   Intents   Views  

    Content  providers   Services   No=fica=ons   Ac=vi=es   Soham  Mondal  
  11. ACTIVITIES •  Provides a screen with which users can interact

    in order to do something Example: dial the phone, take a photo, send an email, or view a map. •  Each activity is given a window in which to draw its user interface. •  An app usually consists of multiple activities •  Typically, one activity in an application is specified as the "main" activity, which is presented to the user when launching the application for the first time. Soham  Mondal  
  12. ANDROID BUILDING BLOCKS Ac=vi=es   Android  manifest.xml   Intents  

    Views   Content  providers   Services   No=fica=ons   Soham  Mondal  
  13. Ac=vi=es   ANDROID BUILDING BLOCKS Android  manifest.xml   Views  

    Content  providers   Services   No=fica=ons   Intents   Soham  Mondal  
  14. INTENTS •  Intents are used to move from Activity to

    Activity •  describes what the application wants •  provides late runtime binding Soham  Mondal  
  15. INTENT INTENT ACTIVITY  1   ACTIVITY  2   ACTIVITY  3

      Soham  Mondal  
  16. ANDROID BUILDING BLOCKS Ac=vi=es   Android  manifest.xml   Intents  

    Views   Content  providers   Services   No=fica=ons   Soham  Mondal  
  17. Ac=vi=es   ANDROID BUILDING BLOCKS Android  manifest.xml   Intents  

    Content  providers   Services   No=fica=ons   Views   Soham  Mondal  
  18. VIEWS •  Views are UI basic building blocks •  Know

    how to draw themselves •  Respond to events •  Organized as trees to build up GUIs •  Described in XML in layout resources Soham  Mondal  
  19. UI ELEMENTS Ac=on  Bar:  made  of  a   couple  of

     ImageViews   Soham  Mondal  
  20. UI ELEMENTS Individual  elements   ImageView   TextView   TextView

      Soham  Mondal  
  21. ANDROID BUILDING BLOCKS Ac=vi=es   Android  manifest.xml   Intents  

    Views   Content  providers   Services   No=fica=ons   Soham  Mondal  
  22. Ac=vi=es   ANDROID BUILDING BLOCKS Android  manifest.xml   Intents  

    Views   Services   No=fica=ons   Content  providers   Soham  Mondal  
  23. CONTENT PROVIDERS •  Enable applications to store and share data.

    •  Makes a specific set of the application's data available to other applications. •  Date stored in the file system, in an SQLite database or on other platforms Soham  Mondal  
  24. File   Ac=vity  1.1   Ac=vity  1.2   Ac=vity  2.1

      Ac=vity  2.2   Applica'on  2   (wants  phone  number)   Applica'on  1  (contacts  app)   Remote   SQLite   db   Ac=vity  3.1   Ac=vity  3.2   Applica'on  3   Content  Provider   Soham  Mondal  
  25. ANDROID BUILDING BLOCKS Ac=vi=es   Android  manifest.xml   Intents  

    Views   Content  providers   Services   No=fica=ons   Soham  Mondal  
  26. Ac=vi=es   ANDROID BUILDING BLOCKS Android  manifest.xml   Intents  

    Views   Content  providers   No=fica=ons   Services   Soham  Mondal  
  27. SERVICES •  Faceless task that runs in the background. • 

    No visual user interface •  Runs in the background certain period of time •  For example: Background music Soham  Mondal  
  28. ANDROID BUILDING BLOCKS Ac=vi=es   Android  manifest.xml   Intents  

    Views   Content  providers   Services   No=fica=ons   Soham  Mondal  
  29. Ac=vi=es   ANDROID BUILDING BLOCKS Android  manifest.xml   Intents  

    Views   Content  providers   Services   No=fica=ons   Soham  Mondal  
  30. NOTIFICATIONS •  Notifies the user about events •  Sent through

    NotificationManager •  Types – persistent icon – sound or vibration Soham  Mondal  
  31. ANDROID BUILDING BLOCKS Ac=vi=es   Android  manifest.xml   Intents  

    Views   Content  providers   Services   No=fica=ons   Soham  Mondal  
  32. Ac=vi=es   ANDROID BUILDING BLOCKS Intents   Views   Content

     providers   Services   No=fica=ons   Android  manifest.xml   Soham  Mondal  
  33. ANDROID MANIFEST •  It names the Java package for the

    application. •  Components of the application — the activities, services, broadcast receivers, and content providers that the application is composed of. •  Permissions •  Lists the library •  And more Soham  Mondal  
  34. ANDROID DEVELOPMENT ENVIRONMENT Soham  Mondal  

  35. THE ECLIPSE IDE YOUR ANDROID DEVELOPMENT ENVIRONMENT Soham  Mondal  

  36. Perspec=ve   Soham  Mondal  

  37. Views   Edit  Area   Views   Views   Soham

     Mondal  
  38.               Shows  the  program

     and   package  structure         Source  of  android  programs  are  shown  here   Shows  various  console  messages,  problems  etc   Outline:   Shows   various   program   elements   Soham  Mondal  
  39. THE UI EDITOR Soham  Mondal  

  40. Drag  and  drop   elements   Actual  UI  view  

    Soham  Mondal  
  41. THE EMULATOR Soham  Mondal  

  42. Soham  Mondal  

  43. Soham  Mondal  

  44. Emulator  screen   Virtual  keyboard   Menu  &  other  

    bu8ons   Soham  Mondal  
  45. HOW TO INSTALL THE SDK Soham  Mondal  

  46. HOW TO INSTALL EVERYTHING? 1.  Eclipse Download and install eclipse

    classic: http://www.eclipse.org/downloads/ 2.  JDK Download and install: http://www.oracle.com/technetwork /java/javase/downloads/index.html 3.  Android SDK starter package Download and install: http://developer.android.com/sdk/index.html 4.  Android development tools (ADT) plugin Download from within Eclipse: https://dl-ssl.google.com/android/eclipse/ 5.  Add platform and other optional components from within eclipse Soham  Mondal  
  47. MONETIZING YOUR APP Soham  Mondal  

  48. APP MONETIZATION Free – Ad supported Premium – Pay per

    title Trial – Upgrade to Premium Freemium – In app billing Paymium – Premium + In-app billing Trial Paymium – Trial + Paymium Subscription – Auto recurrent payment Soham  Mondal  
  49. ADVERTIZING User launches your app User clicks on add in

    your app You get paid for each click Soham  Mondal  
  50. PUBLISHING YOUR APP Soham  Mondal  

  51. CHECKLIST Follow the checklist - http://developer.android.com/distribute/googleplay/publish/ preparing.html Upload your app

    apk at - https://play.google.com/apps/publish/ Soham  Mondal  
  52. Q&A @s0h4m soham.mondal@gmail.com Soham  Mondal